#include using namespace std; long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. long long arr[1000001]={0}; int i,j; arr[1]=1; for(i=1;i<1000001;i++) { for(j=i+i;j<1000001;j+=i) arr[j]=max(arr[j],arr[i]*(j/i)+1); } // for(i=0;i<15;i++) // cout<> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = longestSequence(a); cout << result << endl; return 0; }