#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a vector compress(vector v){ sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); return v; } template map dict(const vector &v){ map res; for(Int i=0;i<(Int)v.size();i++) res[v[i]]=i; return res; } //INSERT ABOVE HERE signed main(){ Int n; cin>>n; vector x(n); for(Int i=0;i>x[i]; x=compress(x); const Int MAX = 1e6+100; const Int INF = 1e9; vector dp(MAX,-INF),ex(MAX,0); for(Int a:x) ex[a]=1; for(Int a:x){ chmax(dp[a],1); for(Int b=a+a;b