include[HTML_REMOVED]
using namespace std;
int res;
const int N=1e3+10;
int f[N],a[N];
int main()
{
int n,i,j;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
for(i=1;i<=n;i++)
{
f[i]=1;
for(j=1;j<i;j++)
{
if(a[i]>a[j])
f[i]=max(f[i],f[j]+1);
}
res=max(res,f[i]);
}
cout<<res;
return 0;
}