#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define ff(i,n) for(i=0;i<n;++i)
#define fff(i,a,b) for(i=a;i<b;++i)
#define pb push_back
#define mp make_pair
#define N 1000050
 
ll lpf[N], mobius[N];
ll fre[N];
 
// Function to calculate least
// prime factor of each number
void least_prime_factor()
{
    for (ll i = 2; i < N; i++)
 
        // If it is a prime number
        if (!lpf[i])
 
            for (ll j = i; j < N; j += i)
 
                // For all multiples which are not
                // visited yet.
                if (!lpf[j])
                    lpf[j] = i;
}
 
// Function to find the value of Mobius function
// for all the numbers from 1 to n
void Mobius()
{
    for (ll i = 1; i < N; i++) {
 
        // If number is one
        if (i == 1)
            mobius[i] = 1;
        else {
 
            // If number has a squared prime factor
            if (lpf[i / lpf[i]] == lpf[i])
                mobius[i] = 0;
 
            // Multiply -1 with the previous number
            else
                mobius[i] = -1 * mobius[i / lpf[i]];
        }
    }
}
 
// Function to find the number of pairs
// such that gcd equals to 1
ll gcd_pairs(vector<ll> a, ll n)
{
    // To store maximum number
    ll maxi = 0;
 
    
    // Find frequency and maximum number
    for (ll i = 0; i < n; i++) {
        fre[a[i]]++;
        maxi = max(a[i], maxi);
    }
 
    least_prime_factor();
    Mobius();
 
    // To store number of pairs with gcd equals to 1
    ll ans = 0;
 
    // Traverse through the all possible elements
    for (ll i = 1; i <= maxi; i++) {
        if (!mobius[i])
            continue;
 
        ll temp = 0;
        for (ll j = i; j <= maxi; j += i)
            temp += fre[j];
 
        ans += temp * (temp - 1) / 2 * mobius[i];
    }
 
    // Return the number of pairs
    return ans;
}
 
// Driver code
vector<ll> arr;
int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll l,r;
    cin>>l>>r;
    if(l==1)
    	l++;
    if(r==1)
		r++;	
    ll n = r-l+1,i;
    for(i=l;i<=r;i++){
		arr.pb(i);
	}	
	ll div=0,gcd1 = gcd_pairs(arr,n);
	ll j;
	for(i=l;i<=r;i++){
		ll f = i,mult=1;
		while((f*mult)<=r){
			if(mult>1)
				div++;
			mult++;
		}
	}
	n = r-l+1;
	ll ans = (n*(n-1))/2 - gcd1-div;
	cout<<(2*ans);
	return 0;
}
//GIVE ME AC!!!!!!!!!!!!!!!!!
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define ll int
#define ld long double
#define floatset() fixed<<setprecision(15)
#define all(n) n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
#define rep(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define pb push_back
#define eb emplace_back
#define INT(...) int __VA_ARGS__;scan(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;scan(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;scan(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;scan(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;scan(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;scan(__VA_ARGS__)
using namespace std;
using vl=vector<ll>;
using vi=vector<int>;
using vs=vector<string>;
using vc=vector<char>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using vvc=vector<vc>;
using vd=vector<double>;
using vp=vector<P>;
using vb=vector<bool>;
using P=pair<ll,ll>;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const ll MOD=1000000007;
const ll mod=998244353;
const double pi=acos(-1);
template<typename T1,typename T2 >
ostream &operator<<(ostream&os,const pair<T1,T2>&p) {
  os<<p.first<<" "<<p.second;
  return os;
}
template<typename T1,typename T2>
istream &operator>>(istream&is,pair<T1,T2>&p) {
  is>>p.first>>p.second;
  return is;
}
template<typename T>
ostream &operator<<(ostream&os,const vector<T>&v) {
  for(int i=0;i<(int)v.size();i++) {
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  return os;
}
template<typename T>
istream &operator>>(istream&is,vector<T>&v) {
  for(T &in:v)is>>in;
  return is;
}
void scan(){}
template<class Head,class... Tail>
void scan(Head&head,Tail&... tail) {
    cin>>head;
    scan(tail...);
}
template<class T>
void print(const T &t) { cout << t << '\n'; }
template<class Head, class... Tail>
void print(const Head &head, const Tail &... tail) {
    cout << head << ' ';
    print(tail...);
}
template<class... T>
void fin(const T &... a) {
    print(a...);
    exit(0);
}
template<typename T1,typename T2>
inline bool chmax(T1&a,T2 b){return a<b&&(a=b,true);}
template<typename T1,typename T2>
inline bool chmin(T1&a,T2 b){return a>b&&(a=b,true);}
vector<ll>prime_factorize(ll N) {
  vector<ll>res;
    for (ll a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        while (N % a == 0) {
            N /= a;
        }
        res.push_back(a);
      if(N==1)break;
    }
    if (N != 1) res.push_back(N);
    return res;
}
int main(){
  LL(l,r);
  long long ans=0;
  rep(i,max(2,l),r+1){
    vl p=prime_factorize(i);
    ll cnt=0;
    ll s=p.size();
    rep(bit,1,(1<<s)){
      ll now=1;
      rep(j,0,p.size()){
        if((bit>>j)&1){
          now*=p[j];
        }
      }
      ll res=(r/now)-((i-1)/now);
      if(__builtin_popcount(bit)%2==1){
        cnt+=res;
      }
      else{
        cnt-=res;
      }
    }
    ans+=cnt;
  }
  rep(i,max(2,l),r+1){
    ans-=r/i;
  }
  fin(ans*2);
}