#include using namespace std; typedef unsigned long long ll; const int maxN = 105; int N; vector primes; bitset<1000005> f; unordered_map memo; void seive(){ for(int i=2; i<=1000000; ++i){ if(f[i]) continue; primes.push_back(i); for(int j=i; j<=1000000; j+=i) f[j] = 1; } } bool isPrime(ll n){ if(n<2) return false; if(n==2) return true; if(n%2==0) return false; ll root = (ll)sqrt(n); for(ll i=3; i<=root; i+=2){ if(n%i==0) return false; } return true; } ll solve(ll n){ if(isPrime(n)) return n+1; ll ans = 1; for(ll p : primes){ if(n==1) break; while(n%p==0){ ans = ans*p + 1; n /= p; } } if(isPrime(n)){ ans = ans*n + 1; n = 1; } return ans; } int main(){ seive(); cin >> N; ll ans = 0; for(int i=0; i> x; ans += solve(x); } printf("%lld", ans); return 0; }