#include using namespace std; int smallestFactor(int n){ int i = 2; while( n%i != 0 ){ i++; if( i == n) return n; } return i; } long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. int move = 0; for(int i=0;i> 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; }