#include<bits/stdc++.h>
#include<bits/extc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using namespace __gnu_pbds;
template<typename TH> void _dbg(const char* sdbg, TH h) { cerr<<sdbg<<"="<<h<<"\n"; }
template<typename TH, typename... TA> void _dbg(const char* sdbg, TH h, TA... t){
	while(*sdbg != ',') { cerr<<*sdbg++; } cerr<<"="<<h<<","; _dbg(sdbg+1, t...);
}
#ifdef DEBUG
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) {{cerr<<#x<<": "; for(auto i:x) cerr<<i<<" "; cerr<<endl;}}
#define debugr(l,r,x) {{cerr<<#x<<": "; for(int i=l;i<=r;i++) cerr<<x<<" "; cerr<<endl;}}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define debugr(l,r,x)
#define cerr while(0) cerr
#endif
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define priority_queue std::priority_queue
#define F first
#define S second
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

ll sum[500005];
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int K;
	cin>>K;
	ll ans=0;
	for(int i=1;i<=K;i++){
		sum[i]=sum[i-1];
		for(int j=1;j*j<=i;j++){
			if(i%j==0) sum[i]+=2;
			if(j*j==i) sum[i]--;
		}
	}
	debugr(1, 10, sum[i]);
	for(int i=1;i<=K;i++){
		//if(K%i!=0) continue;
		ans+=sum[K/i];
	}
	cout<<ans;
}
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<map>
#include<set>

#define int long long
#define fi first
#define se second
#define max Max
#define min Min
#define abs Abs
#define lc (x<<1)
#define rc (x<<1|1)
#define mid ((l+r)>>1)
#define lowbit(x) (x&(-x))
#define fan(x) (((x-1)^1)+1)
#define mp(x,y) make_pair(x,y)
#define clr(f,n) memset(f,0,sizeof(int)*(n))
#define cpy(f,g,n) memcpy(f,g,sizeof(int)*(n))

using namespace std;

inline int read()
{
	int ans=0,f=1;
	char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=(ans<<1)+(ans<<3)+c-'0';c=getchar();}
	return ans*f;
}

inline void write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x/10) write(x/10);
	putchar((char)(x%10)+'0');
}

template<typename T>inline T Abs(T a){return a>0?a:-a;};
template<typename T,typename TT>inline T Min(T a,TT b){return a<b?a:b;}
template<typename T,typename TT> inline T Max(T a,TT b){return a<b?b:a;}

const int N=1e6+5;
int l,r,m,pri[N],phi[N],vis[N],num,all; 

inline void init()
{
	for(int i=2;i<=1000000;++i)
	{
		if(!vis[i])
		{
			pri[++m]=i;
			phi[i]=i-1;
		}
		for(int j=1;j<=m;++j)
		{
			if(pri[j]*i>1000000)
				break;
			vis[i*pri[j]]=1;
			if(i%pri[j]==0)
			{
				phi[i*pri[j]]=phi[i]*pri[j];
				break;
			}
			phi[i*pri[j]]=phi[i]*(pri[j]-1);
		}
	}
}

int query(int n,int x)
{
	vector<int> pp;
	for(int i=2;i*i<=x;++i)
		if(x%i==0)
		{
			pp.push_back(i);
			while(x%i==0) x/=i;
		}
	if(x>1) pp.push_back(x);
	int res=0;
	for(int i=1;i<(1<<pp.size());++i)
	{
		int p=1,num=0;
		for(int j=0;j<pp.size();++j)
			if(i>>j&1) p*=pp[j],++num;
		if(num&1) res+=n/p;
		else res-=n/p;
	}
	return n-res;
}

signed main()
{
	init();
	l=read();r=read();
	all=(r-l+1)*(r-l)/2;
	if(l==1) num+=r-1,++l;
	for(int i=l;i<=r;++i)
		num+=r/i-(l-1)/i-1;
	for(int i=l;i<=r;++i)
		num+=phi[i]-query(l-1,i);
	printf("%lld\n",(all-num)*2);
	return 0;
}