#include <bits/stdc++.h>

using namespace std;
using ll = long long;
#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()


const int n = 20;
const int n2 = 1 << n;
const vector<int> p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};


void solve(long long A, long long B) {
    vector<ll> dp(n2);
    dp.at(0) = 1;
    for (ll x = A; x <= B; ++x) {
        int s = 0;
        rep(i, n) {
            if (x % p.at(i) == 0) {
                s = s | (1 << i);
            }
        }
        rep(i, n2) {
            if (i & s) continue;
            dp.at(i | s) += dp.at(i);
        }
    }
    ll ans = 0;
    rep(i, n2) {
        ans += dp.at(i);
    }
    cout << ans << endl;
}

int main() {
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(A, B);
    return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<complex>
#include<cstdio>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 100005
#define mid(l,r) l+(r-l)/2
#define removeduplicates(vec) vec.erase( unique( vec.begin(), vec.end() ), vec.end() )
#define memset1(v) memset(v,-1,sizeof(v))
#define memset0(v) memset(v,0,sizeof(v))
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll prime[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 solve(){
	ll a,b;
	cin>>a>>b;
	dp[0]=1;
	for(ll i=a;i<=b;i++){
		ll cur=0;
		for(int j=0;j<20;j++)if(i%prime[j]==0)cur|=(1<<j);
		for(int i=(1<<20)-1;i>=0;i--){
			if(i&cur)continue;
			dp[i^cur]+=dp[i];
		}
	}
	ll ans=0;
	for(int i=0;i<(1<<20);i++)ans+=dp[i];
	cout<<ans;
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}