#include using namespace std; int used = 0; int calcMoves(long num){ // cout< a) { // Return the length of the longest possible sequence of moves. int n = a.size(),ans=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; }