#include #include #include using namespace std; int main(){ int N,input,max,ans=0; int dp[100000]; vector x; cin >> N; for(int i=0;i> input; x.push_back(input); } sort(x.begin(),x.end()); for(int i=0;i max) max = dp[j]+1; } dp[i] = max; if(ans < max) ans = max; } cout << ans << endl; return 0; }