#include<stdio.h>
#include<algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <functional>
using namespace std;
int a[100001] = { 0 };
int dp[100001] = { 0 };
int n, w;
int main() {
	scanf("%d",&n);
	int mx = 1;
	for (int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
		#include<stdio.h>
#include<algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <functional>
using namespace std;
int a[100001] = { 0 };
int dp[100001] = { 0 };
int n, w;
int main() {
	scanf("%d",&n);
	int mx = 1;
	fill(dp, dp + n + 1, 1);
	for (int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
		for (int j = 0; j <= i; ++j) {
			if (a[i] > a[j]) {
				++dp[j];
				mx = max(mx, dp[j]);
			}
		}
	}
	printf("%d\n", mx);
}