#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS                  \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = a; i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
template <typename H>
bool chmin(H &v1, const H v2)
{
    if (v1 > v2)
    {
        v1 = v2;
        return true;
    }
    return false;
}
template <typename H>
bool chmax(H &v1, const H v2)
{
    if (v1 < v2)
    {
        v1 = v2;
        return true;
    }
    return false;
}
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
const ll m = 1e9 + 7;

ll powm(ll b, ll p)
{
    if (p == 0)
        return 1;
    if (p % 2 == 1)
        return b * powm(b, p - 1) % m;
    else
    {
        ll t = powm(b, p / 2);
        return t * t % m;
    }
}

int main()
{
    int a, b;
    cin >> a >> b;

    for (int i = b / 2; i > 1; i--)
    {
        if (((a / i) + (a % i != 0) + 1) * i <= b)
        {
            cout << i << endl;
            return 0;
        }
    }
    cout << "1" << endl;
}

#include <bits/stdc++.h>

int main(){
    long long l, r;
    std::cin >> l >> r;
    if(l == r){
        std::cout << "0\n";
        return 0;
    }

    long long res = 0;

    std::vector<long long> vec(r - l + 1);
    for(long long i = r - l; i > 1; i--){
        long long cnt = r / i - (l - 1) / i;
        cnt = cnt * (cnt - 1) / 2;

        for(long long j = i * 2; j <= r - l; j += i){
            cnt -= vec[j];
        }

        vec[i] = cnt;
        if(l <= i) res += cnt - r / i + 1;
        else res += cnt;
    }

    std::cout << res * 2 << "\n";
}
