#include <stdlib.h> #include <stdio.h> int main() { int n=0; while(scanf("%d", &n) != EOF) { int arr1[200] = {0}; for(int i=0; i<n; i++) scanf("%d", &arr1[i]); int arr2[350] = {0}; arr2[0] = 1; int max = 0; for(int i=1; i<n; i++) { int num = 0; for(int j=0; j<i; j++) if(arr1[i] > arr1[j]) num = num > arr2[j] ? num : arr2[j]; arr2[i] = num + 1; max = (max > arr2[i]) ? max : arr2[i]; } printf("%d\n", max); } return 0; }