#include #include #include #include #include #include #include #include #include #include #define REP(x,l,u) for(int x = (l);x<=(u);x++) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair pii; const ll llmax=9223372036854775807; const ll llmin=-9223372036854775808; const int intmin=-2147483648; const int intmax=2147483647; const int mod=1e9+7; ll gcd(ll a,ll b){if(a==0 || b==0) return a+b;else return gcd(b,a%b);} template inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;} template inline void read(T &x){ x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f; } vector primes; template bool isPrime(T x) { if (x <= 4 || x % 2 == 0 || x % 3 == 0) return x == 2 || x == 3; for (T i = 5; i * i <= x; i += 6) if (x % i == 0 || x % (i + 2) == 0) return 0; return 1; } int main() { //ios::sync_with_stdio(0), cin.tie(0); bool test= false; if(test) freopen("/Users/aj/code/HackerRank/input.txt", "r", stdin); REP(i,2,1100000)if(isPrime(i))primes.emplace_back(i); //cout<<*(primes.end()-1); //return 0; ll n; cin>>n; ull tot=0; REP(i,1,n){ ll v; cin>>v; if(v==1) { tot += 1; continue; } vector cprimes,powers; REP(p,0,primes.size()-1){ ll cnt=0; if(v0){ cprimes.emplace_back(primes[p]); powers.emplace_back(cnt); } } if(v!=1) { cprimes.emplace_back(v); powers.emplace_back(1); } ull cnt=1,last=1; for(ll j=(ll)cprimes.size()-1;j>=0;j--) { REP(po,1,powers[j]) { last *=cprimes[j]; cnt += last; } } tot+=cnt; } cout<