//{ #include using namespace std; typedef long long ll; typedef double lf; typedef pair ii; #define REP(i,n) for(ll i=0;i ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";} template ostream& _OUTC(ostream &_s,It _ita,It _itb) { _s<<"{"; for(It _it=_ita;_it!=_itb;_it++) { _s<<(_it==_ita?"":",")<<*_it; } _s<<"}"; return _s; } template ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));} template ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));} template ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));} template void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr< dp; vector pm; ll ispm[MAXn]; ll it(ll x) { if(x==1)return 1; auto tmp=dp.find(x); if(tmp!=dp.end())return tmp->Y; if(x>n; REP(i,n) { ll t; cin>>t; tt+=it(t); } cout<