#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
typedef long long ll;
#include <cmath>
#include<cstdio>
#include<iomanip>

int main(int argc, char *argv[])
{
	ll k;

	cin>>k;
	vector<ll> a(k+1);

	ll s=0;
	ll ret=0;
	for (ll i=k;i>0;i--)
	{
		ll n=k/i;
		ll n3=n*n*n;
		for (ll j=2;i*j<=k;j++)
		{
			n3-=a[i*j];
		}
		a[i]=n3;
		//cerr<<i<<" "<<n3<<endl;
		ret+=n3*i;
		s+=n3;
	}
	cerr<<s<<endl;

	cout<<ret<<endl;

	return 0;
}