#include "bits/stdc++.h" #define wsp cin >> ws; #define sp setprecision #define sn(n) scanf("%lld",&n) #define cn(n) cin>>n #define pr(n) printf("%lld\n",n) #define ff first #define ss second #define prn cout<=b;i--) #define ren(i,n) for(ll i=n-1;i>=0;i--) #define LALIT ios_base::sync_with_stdio(false);cin.tie(0) #define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++) #define mem(n,m) memset(n,m,sizeof(n)) #define mp make_pair #define mod 1000000007 using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef pair pii; typedef pair pli; typedef pair pdi; typedef pair pll; typedef pair pdd; const int N = int(300000)+5; ll t , n ,m, q , k , cnt ,sum , x , y , l , r , ans ; vector v; int main() { LALIT ; cin >> n ; forp(i,1,n) { cin >> x ; if(x==1) { sum++; continue ; } sum++; v.clear() ; for(ll j=2;j*j<=x;j++) { while(x%j==0) { v.pb(j) ; x/=j ; } } if(x>1)v.pb(x) ; sort(v.begin(),v.end()) ; cnt = 1 ; ren(j,v.size()) { cnt = cnt*v[j] ; sum += cnt ; } } cout << sum << endl ; return 0 ; }