#include #define MAX 100005 #define ll long long int using namespace std; ll divide(ll n) { if(n==1) return 1; long ans=-1; if(n%2==0) { ans=2; return ans; } for(ll i=3;i<=sqrt(n);i++) { if(n%i==0) { return i; } } return n; } ll longestSequence(vector a) { // Return the length of the longest possible sequence of moves. ll n=a.size(); ll ans=0; for(int i=0;i> n; vector a(n); for(ll a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } ll result = longestSequence(a); cout << result << endl; return 0; }