#include using namespace std; typedef long long ll ; int n ; ll tab[200]; bool notP[1000141]; vector primes; void sv(){ for(int i = 2 ; i< 1000111 ; i++){ if(!notP[i]){ primes.push_back(i); for(ll j = 1ll * i * i ; j< 1000111 ; j+= i) notP[j]=1; } } } ll get(ll a , ll m ){ ll b = a ; ll last ; vector mul; for(int i = 0 ; b!=1 && 1ll*primes[i]*primes[i]<=a ; i++){ while(b%primes[i]==0){ b/=primes[i]; mul.push_back(primes[i]); } } if(b!=1)mul.push_back(b); ll ret = 0 ; for(int i = mul.size()-1 ; i >= 0; i--){ ret += m ; m*= mul[i]; } ret+=m ; return ret; } int main() { cin >> n ; sv(); // cout <> a ; ans+= get(a,1); } cout <