#include using namespace std; long primeFactors(long n) { vector vec; // Print the number of 2s that divide n while (n%2 == 0) { vec.push_back(2); n = n/2; } // n must be odd at this point. So we can skip // one element (Note i = i +2) for (int i = 3; i <= sqrt(n); i = i+2) { // While i divides n, print i and divide n while (n%i == 0) { vec.push_back(i); n = n/i; } } // This condition is to handle the case when n // is a prime number greater than 2 if (n > 2) vec.push_back(n); long count=1,temp=1; for(int i=vec.size()-1;i>=0;i--){ temp=temp*vec[i]; count=count+(temp); vec.pop_back(); } return count; } long longestSequence(vector a) { // Return the length of the longest possible sequence of moves. long v=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; }