#include <bits/stdc++.h>
using namespace std;
long long dp[100000 + 1];
long long n, a[100000];
int main() {
  scanf("%lld", &n);
  for (long long(i) = (0); ((i)) < ((n)); ++(i)) scanf("%lld", a + i);
  long long res = 0;
  for (long long(i) = (0); ((i)) < ((n)); ++(i)) {
    dp[i] = 1;
    for (long long(j) = (0); ((j)) < ((i)); ++(j)) {
      if (a[i] > a[j]) dp[i] = dp[j] + 1;
    }
    res = max(res, dp[i]);
  }
  printf("%lld\n", res);
  return 0;
}
