#include <bits/stdc++.h>

//#pragma GCC optimize(2)
using namespace std;
#define int long long
typedef long long LL;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int inf = 1e18;
const int mod = 998244353;
//const int mod = 1e9 + 7;
const int maxn = 2e5 + 10;
const int N = 25e5 + 100;

int dp[1<<20];
int p[20]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};

void solve() {
    int a,b;
    cin>>a>>b;
    dp[0]=1;
    for (int i = a; i <=b; ++i) {
        int res=0;
        for (int j = 0; j < 20; ++j) {
            if (i%p[j]==0) res|=1<<j;
        }
        for (int j = 0; j < 1 << 20; ++j) {
            if (!(res&j)){
                dp[j|res]+=dp[j];
            }
        }
    }
    int ans=0;
    for (int k = 0; k < 1 << 20; ++k) {
        ans+=dp[k];
    }
    cout<<ans<<"\n";
}

signed main() {
//    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int _ = 1;
//    cin >> _;
    while (_--) {
        solve();
    }
    return 0;
}
#include<iostream>
#include<vector>
#include<unordered_map>
#include<queue>
#include<string>
using namespace std;

using ll = long long;
ll dp[75][1<<20];
ll A, B;
vector<int> prime;
bool vis[100];
int state[100];

int main()
{
    cin >> A >> B;
    for(int i = 2; i <= B - A; ++i)
    {
        if(!vis[i])
        {
            prime.push_back(i);
            for(int j = i + i; j <= B - A; j += i)
                vis[j] = true;
        }
    }

    const int prime_siz = prime.size();
    for(ll i = A; i <= B; ++i)
    {
        ll cur = i;
        for(int j = 0; j < prime_siz; ++j)
        {
            while(cur % prime[j] == 0)
            {
                cur /= prime[j];
                state[i - A + 1] |= (1 << j);
            }
        }
    }

    dp[0][0] = 1;
    for(int i = 0; i <= B - A; ++i)
    {
        for(int s = 0; s < (1 << prime_siz); ++s)
        {
            dp[i + 1][s] += dp[i][s];
            if(!(state[i + 1] & s))
                dp[i + 1][s | state[i + 1]] += dp[i][s];
        }
    }

    ll res = 0;
    for(int i = 0; i < (1 << prime_siz); ++i)
        res += dp[B - A + 1][i];
    cout << res << endl;

    return 0;
}