#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
	
using namespace std;


 

#define enviar {ios_base::sync_with_stdio(false);}
#define aiuda {cin.tie(NULL); cout.tie(NULL);} 

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) ;F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
#define exacto(v) cout << setprecision(v) << fixed;



#define ll long long
#define lld long double
#define eb emplace_back
#define em emplace
#define ef emplace_front
#define f first
#define s second
#define big greater<ll>()
#define bpc(x) __builtin_popcount(x)
#define bpc2(x) __builtin_clz(x)
#define DIE(args...) {print(args); return;} 

#define ar(v)  array<int,v>
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x).size()
#define meminf(v) memset(v,  0x3f , sizeof(v))
#define mem(v,x) memset(v , x , sizeof v);
#define ai(a, n) for (int ele = 0; ele < n; ele++) cin >> a[ele];
#define ao(a, n) {for (int ele = 0; ele < (n); ele++) { if (ele) cout << " "; cout << a[ele]; } cout << '\n';}
#define readgraph(list, edges) for (int i = 0; i < edges; i++) {int n1, n2; cin >> n1 >> n2; n1--; n2--; list[n1].eb(n2); list[n2].eb(n1);}
 

template <typename T>
struct combinator {
    T t_;
    combinator(T&& t) : t_(std::forward<T>(t)) {}
    
    template <typename... Args>
    auto operator () (Args&&... args) const 
    {
        return t_(*this, std::forward<Args>(args)...);
    }
};


template<class T> bool umin(T& a, const T& b) { return b<a?a=b, 1:0; }
template<class T> bool umax(T& a, const T& b) { return a<b?a=b, 1:0; } 

string to_string(bool b) {return b?"true":"false"; }

string to_string(char c) { return string(1, c);}

string to_string(const char* s) { return string(s); }

string to_string(string s) { return s; }

template<class T> string to_string(T v) { bool f=1; string res; EACH(x, v) { if(!f) res+=' '; f=0; res+=to_string(x); } return res; }

template<class A> void write(A x) { cout << to_string(x); }

void print() { write("\n"); }

template<class H, class... T> void print(const H& h, const T&... t) {  write(h); if(sizeof...(t)) write(' '); print(t...); }




typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef map<ll, ll> mll;
typedef priority_queue<int, std::vector<int>, std::greater<int>> priomin;


const ll mod = 998244353;
const ll maxsize =3e5 + 10;
const ll inf = 0x3f3f3f3f3f3f3f3f ;
// size, caracter

ll c[maxsize];





bool sieve[100];
vll primes(100);

ll m;
void solve()
{
	
	for(ll i =2; i <= 72 ; i++)
	{
		if (sieve[i]) continue;
		primes[m++]  = i;
		for(ll j = i*i; j <= 72 ; j+=i)
		{
			sieve[j] = true;
		}
	}
	
	
	ll a, b;
	cin >> a >> b;
	
	//m--;
	vll dp(1<<m , 0);
	dp[0] = 1;
	
	

	for( ll i = a; i <= b ; i++)
	{
		ll mask = 0;
		
		FOR(j , m)
		{
			if (i%primes[j] == 0 ) mask |= 1<<j;
		}	
		
		FOR(k , 1<<m)
		{
			if ((k & mask) == 0)
			{
				dp[k | mask] += dp[k];
			}
		}
		
	}
//	FOR(i , m) print(primes[i]);
	
	ll ans = 0;
	FOR(i , 1<<20 ) ans += dp[i];
	
	print(ans); 
}

int main(){
	
	enviar aiuda
	
	int tc = 1;
	//cin >> tc;
	 
	
    while(tc--)  solve();
    
	return 0;
} 
	  
	 
 

	 

 

//Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
using namespace std;
typedef vector<vector<ll>> matrix;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=500023;
bool vis[N];
vector <int> adj[N];
int isprime[N];
ll dp[(1<<21)+10];
void solve()
{
    ll a,b;
    cin>>a>>b;
    vl primes;
    for(int i=2;i<=72;i++)
    {
        if(isprime[i]==i)
            primes.pb(i);
    }
    dp[0]=1;
    ll fun[100]={0};
    int cnt=0;
    for(ll x=a;x<=b;x++)
    {
        int mask=0;
        for(int i=0;i<primes.size();i++)
        {
            if(x%primes[i]==0)
            {
                mask+=(1<<i);
            }
        }
        fun[x-a]=mask;
        if(mask==0)
            cnt++;
    }
    dp[0]=(1ll<<cnt);
    ll ans=dp[0];
    for(int i=1;i<(1<<(primes.size()));i++)
    {
        int consider=0;
        for(ll j=0;j<60;j++)
        {
            if((i&(1ll<<j))!=0)
            {
                consider=j;
                break;
            }
        }
        for(ll k=a;k<=b;k++)
        {
            int mask=0;
            mask=fun[k-a];
            if((mask&i)==mask && (mask&(1<<consider))!=0)
            {
                dp[i]+=dp[i^mask];
            }
        }
        ans+=dp[i];
    }
    cout<<ans<<'\n';
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    for(int i=1;i<N;i++)
        isprime[i]=i;
    for(int i=2;i<N;i++)
    {
        if(isprime[i]!=i)
            continue;
        for(int j=i;j<N;j+=i)
            isprime[j]=i;
    }
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}