#include <bits/stdc++.h>
using namespace std;

int main(){
    long long A, B;
    scanf("%lld %lld", &A, &B);

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

    vector <long long> dp(1 << 20, 0);
    dp[0] = 1;

    for(long long x = A; x <= B; x++){
        int mask = 0;
        for(int i = 0; i < 20; i++)
            if(x % primes[i] == 0)mask |= 1 << i;

        for(int i = (1 << 20) - 1; i >= 0; i--)
            if((i & mask) == 0)dp[i | mask] += dp[i];
    }

    printf("%lld\n", accumulate(dp.begin(), dp.end(), 0LL));

    return 0;
}
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD 1000000007//998244353//1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef  long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef ll ValType;
template<typename  T> void maxtt(T& t1, T t2) {
    t1=max(t1,t2);
}
template<typename  T> void mintt(T& t1, T t2) {
    t1=min(t1,t2);
}
#define MAX (135)

bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="RDLU";
const ll MOD2 = (ll)MOD * (ll)MOD;
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"YES" : "NO");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD){
    x+=y; if (x>=mod) x-=mod;
    if(x<0) x+=mod;
    assert(x>=0 && x<mod);
}
void et(int x=-1) {
    printf("%d\n", x); exit(0);
}
ll fastPow(ll x, ll y, int mod=MOD) {
    ll ans = 1;
    while(y>0) {
        if(y&1) ans = (x * ans)%mod;
        x = x*x%mod;
        y>>=1;
    }
    return ans;
}
ll gcd1(ll x, ll y) {
    return y?gcd1(y,x%y):x;
}


int cnt[100];
int ps[20]={2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};
ll dp[1<<20];
void fmain(int tid) {
    scanf("%lld%lld",&ln,&lm);
    int N=lm-ln+1;
    for(ll i=ln;i<=lm;i++) {
        REP(j,20) if(i%ps[j]==0) {
            cnt[i-ln+1] |= 1<<j;
        }
    }
    dp[0]=1;
    int fe=0;
    REQ(i,N) {
        if (cnt[i]==0) {
            fe++; continue;
        }
        for(int j=(1<<20)-1; j>=0; j--) if ((j&cnt[i])==cnt[i]) {
            int sm=j-cnt[i];
            dp[j]+=dp[sm];
        }
    }
    ll ans=0;
    REP(j, 1<<20) {
        ans += dp[j];
    }
    ans *= 1LL<<fe;
    printf("%lld\n", ans);
}
int main() {
    int t=1;
//    init();
//    scanf("%d", &t);
    REQ(i,t) {
        fmain(i);
    }
    return 0;
}
