// chrono::system_clock::now().time_since_epoch().count()
#include <bits/stdc++.h>

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define debug(x) cerr << #x << " = " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int MAXN = (int)1e6 + 5;

ll dp[MAXN];
int L, R;
ll ans;

void solve() {
    cin >> L >> R;

    for (int g = R; g >= 1; g--) {
        int cnt = 0;

        for (int i = g; i <= R; i += g) {
            if (i >= L) {
                cnt++;
            }

            dp[g] -= dp[i];
        }

        dp[g] += cnt * 1ll * cnt; 
        
        if (g > 1) {
            ans += dp[g];
        }
    }

    for (int a = L; a <= R; a++) {
        for (int b = a; b <= R; b += a) {
            if (a == 1 || b == 1) {
                continue;
            }
            
            if (a == b) {
                --ans;
            }
            else {
                ans -= 2;
            }
        }
    }

    cout << ans << '\n';
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int tt = 1;

    for (int i = 1; i <= tt; ++i) {
        solve();
    }

    return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  int l,r;
  cin>>l>>r;
  vector<ll> po(r+1,0);
  ll ans=0;
  for(int g=r;g>=2;g--){
    po[g]=r/g-(l-1)/g;
    po[g]*=po[g];
    for(int g2=2*g;g2<=r;g2+=g){
      po[g]-=po[g2];
    }
    ans+=po[g];
    if(g>=l)ans-=r/g*2-1;
  }
  cout<<ans<<endl;
}