#include using namespace std; #include using namespace atcoder; using ll = long long; using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N; cin >> N; ll ans = 0; const int L = 1 << 17; vector pr(L); for(ll p = 2; p * p <= N; p++) { if(pr[p]) continue; for(ll k = 1; k * p < L; k++) { pr[k * p] = true; } ll x = p; while(x <= N / p) { x *= p; ans += x; } } cout << ans << endl; }