#include <bits/stdc++.h>
char str[10001];
int main() {
  int T, i, j;
  int len, ans;
  scanf("%d", &T);
  for (int i = 0; i < T; i++) {
    scanf("%d", &str[i]);
  }
  len = T;
  ans = 0;
  for (i = 0; i < len; i++) {
    for (j = 0; j < ans; j++)
      if (str[j] >= str[i]) {
        str[j] = str[i];
        break;
      }
    if (j == ans) {
      str[j] = str[i];
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
