#include<bits/stdc++.h> #include<unordered_map> #define ll long long int #define mod 1000000007 #define mp make_pair #define pb emplace_back #define fi first #define se second #define sd(t) scanf("%d",&t) #define pd(t) printf("%d\n",t) #define slld(t) scanf("%lld",&t) #define plld(t) printf("%lld\n",t) #define For(i,n) for(ll i=0;i<n;i++) #define speed ios::sync_with_stdio(false); cin.tie(0) using namespace std; //unordered_map<ll ,int>s; unordered_map<ll ,ll>po; int main() { ll n; cin>>n; ll total=0; for(ll i=0;i<n;i++) { ll x; cin>>x; if(x==1) { total+=1; continue; } if(x==2||x==3) { total+=(x+1); continue; } ll mark=1; total+=x; for(ll j=2;j<=sqrt(x);j++) { if(x%j==0) { total+=mark; mark=(x/j); x=x/j; j--; } } total+=mark; //cout<<total<<" "; } cout<<total<<"\n"; return 0; }