#include<bits/stdc++.h>
using namespace std;
#define MAXN 200005
#define lowbit(x) (x&-x)
#define reg register
typedef long long LL;
typedef unsigned long long uLL;
typedef unsigned int uint;
const int INF=0x7f7f7f7f;
const int jzm=233;
const int mo=998244353;
const double Pi=acos(-1.0);
typedef pair<int,int> pii;
const double PI=acos(-1.0);
template<typename _T>
_T Fabs(_T x){return x<0?-x:x;}
template<typename _T>
void read(_T &x){
	_T f=1;x=0;char s=getchar();
	while(s>'9'||s<'0'){if(s=='-')f=-1;s=getchar();}
	while('0'<=s&&s<='9'){x=(x<<3)+(x<<1)+(s^48);s=getchar();}
	x*=f;
}
LL a,b,prime[100],cntp,val[100],tot,S[100],dp[(1<<20)+5],ans;
bool oula[100];
void init(){
	for(LL i=2;i<=72;i++){
		if(!oula[i])prime[++cntp]=i;
		for(LL j=1;j<=cntp&&1ll*prime[j]*i<=72;j++){
			oula[prime[j]*i]=1;
			if(i%prime[j]==0)break;
		}
	}
}
int main(){
	read(a);read(b);init();dp[0]=1;int lim=(1<<cntp)-1;
	for(LL i=a;i<=b;i++)val[++tot]=i;
	for(int i=1;i<=tot;i++){
		for(int j=1;j<=cntp;j++)
			if(val[i]%prime[j]==0)S[i]|=(1<<j-1);
	}
	for(int i=1;i<=tot;i++)
		for(int j=lim;j>=0;j--)
			if(!(j&S[i]))dp[j|S[i]]+=dp[j];
	for(int j=0;j<=lim;j++)ans+=dp[j];
	printf("%lld\n",ans);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double

int main() {
    ll A, B;
    cin >> A >> B;
    vector<int> primes = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};
    int K = primes.size();
    vector<ll> from(1<<K, 0), to(1<<K, 0);
    from[0] = 1;
    for (ll i = A; i <= B; i++) {
        fill(to.begin(), to.end(), 0);
        ll mask = 0;
        for (int j = 0; j < K; j++) {
            if (i%primes[j] == 0) mask |= (1<<j);
        }
        for (int j = 0; j < (1<<K); j++) {
            to[j] += from[j];
            if ((j&mask) == 0) to[j|mask] += from[j];
        }
        swap(from, to);
    }
    ll ans = 0;
    for (ll n : from) ans += n;
    cout << ans << endl;
    return 0;
} 
