#include #include #define MAX_N 100000 using namespace std; int main(){ int x[MAX_N] = {0}; int n; cin >> n; for(int d = 0; d < n; d++){ cin >> x[d]; } // sort(x,x+n); int max = x[n-1]; int ans = 1; int count = 1; int tmp = 0; for(int d = 0; d < n; d++){ tmp = d; for(int e = 1; e < n; e++){ if(2 * x[tmp] > max) break;//次の数列の要素はないのでストップ if(x[e] % x[tmp] == 0){ count++; tmp = e; } } if(count > ans){ ans = count;}//更新 count = 0; } cout << ans << endl; return 0; }