include[HTML_REMOVED]
using namespace std;
const int N = 1010;
int n;
int w[N], f[N];
int main() {
cin >> n;
for (int i = 1; i <= n; i)
cin >> w[i];
int maxn = 1;
for (int i = 1; i <= n; i)
{
f[i] = 1;
for (int j = 0; j <= i - 1; j)
if (w[i] > w[j]) f[i] = max(f[i], f[j] + 1);
}
for (int i = 1; i <= n; i)
maxn = max(maxn, f[i]);
cout << maxn << endl;
return 0;
}