#include #ifdef LOCAL_TEST #pragma comment(linker, "/stack:16777216") #endif using namespace std; typedef long long int ll; typedef vector vll; typedef vector vi; typedef pair pp; typedef vector vpp; #define sz(a) (int)((a).size()) #define pb push_back #define mp(a, b) (make_pair(a, b) ) #define all(c) (c).begin(),(c).end() #define fill(a) (memset(a, 0, sizeof (a))) #define fillA(a) (memset(a, -1, sizeof (a))) #define rep(i,n) for(int i=0;i<(n);++i) #define repA(i,a,n) for(int i=a;i<=(n);++i) #define repD(i,a,n) for(int i=a;i>=(n);--i) const long double PI = 3.141592653589793238462643383; #define X first #define Y second #define endl '\n' // Functions struct Rcompare{bool operator()(pp lhs,pp rhs){return lhs.X>rhs.X;}}; struct compare{bool operator()(pp lhs,pp rhs){return lhs.X0)return a;return -a;} ll Ceil(ll a,ll b){if(a%b==0)return a/b;else return a/b+1;} double Abs(double a){if(a>0)return a;return -a;} ll pow(ll x,ll y) { if(y==0)return 1; ll tmp=pow(x,y/2); if(y%2==1)return ((tmp*tmp)*x); return (tmp*tmp); } const int MAX = 2e6; const int MOD = 1e9+7; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifdef LOCAL_TEST ifstream cin("in.txt");ofstream cout("out.txt");//tm=clock(); #endif ll t;cin>>t; ll ans=0; rep(aa,t) { ll n,cnt=1,stp=0;cin>>n; ll s=sqrt(n); vll pr;ll ntmp=n; repA(i,2,s+1)if(n%i==0)while(n%i==0)n/=i,pr.pb(i); if(n>1)pr.pb(n); repD(i,sz(pr)-1,0) { stp+=cnt,cnt=cnt*pr[i]; } ans+=ntmp+stp; } cout<