/*Program created by Shantanu Tripathi(SHAAN) IPG_2014079 ABV-IIITM,Gwalior */ #include using namespace std; #define INF 2147483647 #define INFLL 9023372036854775807LL #define _ ios::sync_with_stdio(false); cin.tie(0); #define T() int t; cin>>t; while(t--) #define f0(i,n) for(int i=0;i=n;i--) #define r(n) long long n; cin>>n; #define r2(x,y) long long x,y; cin>>x>>y; #define r3(x,y,z) long long x,y,z; cin>>x>>y>>z; #define r4(x,y,z,a) long long x,y,z,a; cin>>x>>y>>z>>a; #define r5(x,y,z,a,b) long long x,y,z,a,b; cin>>x>>y>>z>>a>>b; #define r6(x,y,z,a,b,c) long long x,y,z,a,b,c; cin>>x>>y>>z>>a>>b>>c; #define max(a,b) (((a)>(b))?(a):(b)) #define min(a,b) (((a)<(b))?(a):(b)) #define max3(a,b,c) ((max(a,b)>(c))?max(a,b):c) #define min3(a,b,c) ((min(a,b)<(c))?min(a,b):c) #define sz(a) int((a).size()) #define pb push_back #define ppb pop_back #define mp make_pair #define all(c) (c).begin(),(c).end() #define tr(c,i) for( typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define decl(c,i) decltype((c).begin()) i = (c).begin(); #define type(c,i) typeof((c).begin()) i = (c).begin(); #define present(c,x) ((c).find(x) != (c).end()) #define apresent(c,x) (find(all(c),x) != (c).end()) #define clr(x,__) memset(x,__,sizeof(x)) #define F first #define S second #define MOD 1000000007 //10^9+7 #define SQ 1007 typedef long long ll; typedef vector vi; typedef vector vd; typedef vector vb; typedef vector vll; typedef vector matrix; typedef pair pi; typedef pair pll; typedef vector vpi; typedef vector vpll; typedef vector vstr; typedef map msi; typedef long double ld; #define rep1(i,k,n) for(i=k;i<=n;i++) // loop : use int i; before #define rep2(c,i) for(;i != (c).end(); i++) //iteration : use decl(c,i) or type(c,i) before #define dis(x1,y1,x2,y2) sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)) #define MAX 1000007 //10^6+7 vb isprime(MAX+1,true); int small[MAX+1]; inline void sieve() { isprime[0]=isprime[1]=0; int i,j; for(i=4;i<=MAX;i+=2) isprime[i]=0;for(i=3;i<=SQ;i+=2) if(isprime[i]) for(j=i*i;j<=MAX;j+=(i+i)) isprime[j]=0; } inline void smallprime(){int i,j; small[0]=small[1]=0;for(i=2;i<=MAX;i++) small[i]=(i&1)?i:2;for(i=3;i<=SQ;i+=2) if(small[i]==i) for(j=i<<1;j<=MAX;j+=i) if(small[j]==j) small[j]=i;} inline void fact(ll n){ll temp=small[n],prod=1,count=0;while(n>1) {if(temp==small[n])count++;else{cout<57)&&c!='-');c=getchar());if(c=='-'){neg=1;c=getchar();}for(;c>47&&c<58;c=getchar()){x=(x*10)+(c-48);}if(neg)x=-x;} inline bool ispalin(string s) { for(int i=0,j=s.size()-1;i<=j;i++,j--) if(s[i]!=s[j]) return false; return true; } inline ll gcd(ll a,ll b) { return ((b==0)?a:gcd(b,a%b)); } inline ll Pow(ll a,ll b){ll x=1;while(b>0){if(b&1)x=(x*a);a*=a;b>>=1;}return x;} inline ll modexp(ll a,ll b,const ll &m) { ll d=1; while(b>0) { if(b&1) d=(d*a)%m; a=(a*a)%m; b=b>>1; } return (d<0?d+m:d); } inline ll invmod(const ll &a,const ll &mod){return modexp(a,mod-2,mod);} inline ll mulmod(ll a,ll b,const ll &mod){ll x=0;a%=mod;while(b>0){if(b&1){x+=a;if(x>=mod)x%=mod;}a<<=1;if(a>=mod)a%=mod;b>>=1;}return (x<0?x+mod:x);} inline bool isPrime(const ll &x){if(x<=3)return(x<=1?0:1);if(!(x&1)||!(x%3))return 0;for(ll i=5;i*i<=x;i+=6)if(!(x%i)||!(x%(i+2)))return 0;return 1;} inline int digsum(ll n){ int sum = 0; n=abs(n); while(n>0){ sum += n%10 ; n /=10; } return sum; } inline ll ncr(long n ,long r){vector > dp(2,vector(r+1,0)); f1(i,n) {fk(j,0,min(i,r)) dp[i&1][j] = ((i==j || j==0)?1:(dp[(i-1)&1][j] + dp[(i-1)&1][j-1])%MOD); }return dp[n&1][r]; } inline ll ncr2(long n, long r) { ll ans=1; for(long i = n;i>r;i--) ans = (ans*i)%MOD; f1(i,n-r) ans = (ans*(modexp(i,MOD-2,MOD)))%MOD; return ans; } inline long phi(ll n){ ll ret=n; ll i = 2; if(n%i==0){ ret-=ret/i; while(n%i==0)n/=i;} for(i=3; i*i<=n; i++)if(n%i==0){ ret-=ret/i; while(n%i==0)n/=i;} if(n>1)ret-=ret/n;return ret;} inline long phi2(ll n){if(n==1)return 1; ll temp=small[n], count=n; while(n>1){if(temp!=small[n]){ count -= count/temp; temp = small[n];} n /= small[n]; }count -= count/temp; return count;} inline ll fib(ll n,const ll &mod){ll i,j,h,k,t;i=h=1;j=k=0;while(n>0){if(n&1){t=j*h%mod;j=(i*h+j*k+t)%mod;i=(i*k+t)%mod;}t=h*h%mod;h=(2*k*h+t)%mod;k=(k*k+t)%mod;n>>=1;}return j;} int main() { _ smallprime(); r(n) ll tot = 0; while(n--) { int x; cin>>x; ll ans = 0; if(x<=MAX) { while(x>1) { ans += x; x = x/small[x]; } ans+=1; tot += ans; } } cout<