#include using namespace std; #define ll long long #define sp ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) #define mod 10000007 //#define mp make_pair #define pi pair #define vi vector #define vl vector #define pb push_back #define inf 1000000000 #define mxn 1000005 bool prime(ll a){ if(a==2||a==3||a==5) return true; ll i; if(a%2==0) return false; for(i=3;i*i<=a;i+=2) { if(a%i==0) return false; } return true; } ll func(ll x){ ll total=0; while(x!=0){ if(x==1){ total+=1; x=0; break; } if(prime(x)){ total+=x+1; return total;} if(x%2==0){ total+=x; x=x/2; } else { for(int i=3;i*i<=x;i+=2){ if(x%i==0){ total=total+x; x=x/i; break;} } } } return total; } ll f[mxn]; int main(){ ll i,j; ll n; cin>>n; ll ans=0; for(i=0;i>q; ans+=func(q); } cout<