//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
//#pragma GCC optimize("unroll-loops")

#ifdef __APPLE__
    # include <iostream>
    # include <cmath>
    # include <algorithm>
    # include <stdio.h>
    # include <cstdint>
    # include <cstring>
    # include <string>
    # include <cstdlib>
    # include <vector>
    # include <bitset>
    # include <map>
    # include <queue>
    # include <ctime>
    # include <stack>
    # include <set>
    # include <list>
    # include <random>
    # include <deque>
    # include <functional>
    # include <iomanip>
    # include <sstream>
    # include <fstream>
    # include <complex>
    # include <numeric>
    # include <immintrin.h>
    # include <cassert>
    # include <array>
    # include <tuple>
    # include <unordered_map>
    # include <unordered_set>
    # include <thread>
#else
    # include <bits/stdc++.h>
#endif

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define files(name) name!=""?freopen(name".in","r",stdin),freopen(name".out","w",stdout):0
#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define elif else if
#define mp make_pair
#define pb push_back
#define fir first
#define sec second

using namespace std;
#define int long long

typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long double ld;
typedef long long ll;

const int arr=2e5+10;
const int ar=2e3+10;
const ld pi=acos(-1);
const ld eps=1e-10;
const ll md=1e9+7;
const ll inf=1e18+10;

///---program start---///
/*
#define arr (int)(5e5+10)

int bpow(int a,int n)
{
    int res=1;
    while (n){
        if (n&1){
            res=res*a%md;
        }
        n/=2;
        a=a*a%md;
    }
    return res;
}

int f[arr];
int rf[arr];

int C(int n,int k)
{
//    cerr<<"C("<<n<<","<<k<<")"<<"\n";
//    cerr<<f[n]<<" "<<rf[n-k]<<" "<<rf[k]<<"\n";
    return f[n]*rf[n-k]%md*rf[k]%md;
}

signed main()
{
    #ifdef __APPLE__
        files("barik");
        freopen("debug.txt","w",stderr);
    #endif

    f[0]=1;
    for (int i=1;i<arr;i++){
        f[i]=f[i-1]*i%md;
    }
    rf[arr-1]=bpow(f[arr-1],md-2);
    for (int i=arr-2;i>=0;i--){
        rf[i]=rf[i+1]*(i+1)%md;
    }

    int n,m;
    cin>>n>>m;
    int ans=0;
    for (int i=0;i<=n;i++){
//        cout<<i<<" "<<i+(n-i)*2<<" "<<m<<"\n";
        if (i+(n-i)*2<=m){
            int kf=(i%2==0?+1:-1);
            cout<<"keks :: "<<C(n,i)*C(m,i)%md*f[i]<<"\n";
            int cur=C(n,i)*C(m,i)%md*f[i] %md* C(m-i,n-i)%md*C(m-i-(n-i),n-i)%md*f[n-i]%md*f[n-i];
            cout<<i<<" :: "<<kf<<" "<<cur<<"\n";
            ans+=kf*cur;
            ans%=md;
            if (ans<0){
                ans+=md;
            }
        }
    }
    cout<<ans<<"\n";
}
*/
const int SQRT_MAXN = 100000; // корень из максимального значения N
const int S = 10000;
bool nprime[SQRT_MAXN], bl[S];
int primes[SQRT_MAXN], cnt;
int keks[S];
int cur_real_value[S];

signed main() {
    #ifdef __APPLE__
        files("barik");
            freopen("debug.txt","w",stderr);
    #endif

    int n;
    cin >> n;
    int nsqrt = SQRT_MAXN-3;
    for (int i=2; i<=nsqrt; ++i)
        if (!nprime[i]) {
            primes[cnt++] = i;
            if (i * 1ll * i <= nsqrt)
                for (int j=i*i; j<=nsqrt; j+=i)
                    nprime[j] = true;
        }

    ll ans=0;
    int result = 0;
    for (int k=0, maxk=n/S; k<=maxk; ++k) {
        memset (bl, 0, sizeof bl);
        int start = k * S;
        for (int i=0;i<S;i++){
            keks[i]=1;
        }
        for (int i=0;i<S;i++){
            cur_real_value[i]=start+i;
        }
        for (int i=0; i<cnt; ++i) {
            int start_idx = (start + primes[i] - 1) / primes[i];
            int j = max(start_idx,2ll) * primes[i] - start;
            int cur_div=primes[i];
            for (; j<S; j+=cur_div) {
                int step=0;
                while (cur_real_value[j]%cur_div==0){
                    step++;
                    cur_real_value[j]/=cur_div;
                }
                keks[j]*=step+1;
                bl[j] = true;
            }
        }
        for (int i=0;i<S;i++){
            if (cur_real_value[i]!=1){
                keks[i]*=2;
            }
        }
        if (k == 0)
            bl[0] = bl[1] = true;
        for (int i=0; i<S && start+i<=n; ++i) {
            if (!bl[i]) {
                ++result;
                keks[i]=2;
            }
//            cout<<"keks :: "<<start+i<<" "<<keks[i]<<"\n";
            ans+=1ll*(start+i)*keks[i];
        }
    }
    cout << ans <<"\n";

}


Measured memory_bytes: 3960