#include <iostream>
using namespace std;
const int N = 1e3+10;
int a[N], dp[N];
int main(){
int n;
cin >> n;
for (int i = 1; i <= n; i++){
cin >> a[i];
dp[i] = 1;
}
for(int i = 1; i <= n; i++){
for(int j = 1; j < i; j ++){
if(a[i] <= a[j]) continue;
dp[i] = max(dp[i], dp[j]+1);
}
}
int ans = -1;
for(int i = 1; i <= n; i++){
ans = max(ans, dp[i]);
}
cout << ans;
return 0;
}