#include using namespace std; #define pb push_back #define mp make_pair #define timesaver ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const unsigned int mod=1e7+7; #define PI 3.14159265 typedef long long int ll; const long long int N=1e5; ll lazy[400009],segtree[400009],x,y,n,d,a[200009]; bool isprime(ll x) { if(x<=1) return false; if(x<=3) return true; if(x%2==0 || x%3==0) return false; for(int i=5 ; i*i<=x ; i=i+6) { if(x%i==0 || x%(i+2)==0) return false; } return true; } int main() { timesaver; ll ans=0,l,n,p=0,q=0,cnt=0,t=0,z=0,w=0,pre=1e5,mid,a[200009]={0},b[100009]={0},t1,t2,now,r=0,k=0,i=0,j=0,flag=0,temp=0,e=-1e4,o=0; cin>>t; while(t--) { cin>>n; if(n==1) ans++; else if(isprime(n)==true) ans+=n+1; else { while(n>0) { if(isprime(n)==true) { ans=ans+n+1; break;} else if(n%2==0) ans=ans+n , n=n/2; else { j=3; while(n%j!=0) j+=2; ans=ans+n; n=n/j; } } } } cout<