#include using namespace std; #define ll long long vector p; void s() { vector b(1e6,true); for (ll i=4; i<1e6; i+=2) b[i]=false; p.push_back(2); for (ll i=3;i<1e6;i+=2) { if (b[i]) { p.push_back(i); for (ll j=i*i; j<1e6; j+=i) b[j]=false; } } } int main() { s(); ll n,i,r=0,x; cin>>n; while(n--) { vector v; cin>>x; if(x==1) r+=1; else { r++; for(i=0;i1&&x%p[i]==0) { x/=p[i];v.push_back(p[i]); if(x==1) i=p.size(); } } if(x!=1) v.push_back(x),x=1; for(i=v.size()-1;i>=0;i--) { x*=v[i];r+=x; } } } cout<