#include using namespace std; typedef pair P; typedef pair> PP; typedef long long ll; const double EPS = 1e-8; const int INF = 1e9; const int MOD = 1e9+7; int dy[] = {0,1,0,-1}; int dx[] = {1,0,-1,0}; mapprime_factor(int n){ mapres; for(int i=2;i*i<=n;i++){ while(n%i==0){ ++res[i]; n /= i; } } if(n!=1)res[n]=1; return res; } int grundy(int x){ set s; map fact = prime_factor(x); for(auto it = fact.begin();it != fact.end();it++){ s.insert(grundy(x / it->first)); if(it->second >= 2)s.insert(grundy(x / (it->first*it->first))); } int res = 0; while(s.count(res))res++; return res; } int main(void) { int n; cin >> n; vector m(n); for(int i=0;i> m[i]; } int res = 0; for(int i=0;i