#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using ll = long long;
using ld = long double;
#define all(s) (s).begin(),(s).end()
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define rep(i, n) rep2(i, 0, n)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)
#define rever(vec) reverse(vec.begin(), vec.end())
#define sor(vec) sort(vec.begin(), vec.end())
#define fi first
#define se second
#define P pair<ll,ll>
const ll mod = 998244353;
//const ll mod = 1000000007;
const ll inf = 2000000000000000000ll;
static const long double pi = 3.141592653589793;
void vcin(vector<ll> &n){for(int i=0;i<int(n.size());i++) cin>>n[i];}
void vcout(vector<ll> &n){for(int i=0;i<int(n.size());i++){cout<<n[i]<<" ";}cout<<endl;}
void YesNo(bool a){if(a){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}}
void YESNO(bool a){if(a){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}}
template<class T,class U> void chmax(T& t,const U& u){if(t<u) t=u;}
template<class T,class U> void chmin(T& t,const U& u){if(t>u) t=u;}
ll modPow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; }
ll binary_gcd(ll u, ll v){
    if(min(u, v) == 0) return u|v;
    int shift = __builtin_ctzll(u|v);
    u >>= __builtin_ctzll(u);
    while(v){
        v >>= __builtin_ctzll(v);
        if(u > v) swap(u, v);
        v -= u;
    }
    return u << shift;
}

ll pov(ll base, ll exp, ll mod){
	ll ret = 1;
	while(exp){
		if(exp&1) ret = (__int128)ret * base % mod;
		base = (__int128)base * base % mod;
		exp >>= 1;
	}
	return ret;
}

bool check_composite(ll n, int a, ll d, int s){
	ll x = pov(a, d, n);
	if(x == 1 || x == n-1) return 0;
	for(int r=0;r<s;r++){
		x = (__int128)x * x % n;
		if(x == n-1) return 0;
	}
	return 1;
}

bool MillerRabin(ll n, int iter = 5){
	if(n < 4) return  n == 2 || n == 3;
	int s = __builtin_ctzll(n-1);
	ll d = (n-1) >> s;
	for(int i=0;i<=iter;i++){
		int a = rand() % (n-3) + 2;
		if(check_composite(n, a, d, s)) return 0;
	}
    return 1;
}

ll rho_pollard(ll n){
	if((n&1) == 0) return 2;
	ll x, y, c, g = 1;
	x = y = rand() % n + 1;
	c = rand() % n + 1;
	while(g == 1){
		x = ((__int128)x*x+c) % n;
		y = ((__int128)y*y+c) % n;
		y = ((__int128)y*y+c) % n;
		g = binary_gcd(abs(x-y), n);
	}
	return g;
}

void factorize(ll num, vector<ll> &facts){
	if(num == 1) return;
	if(MillerRabin(num)){
		facts.push_back(num);
		return;
	}
	ll divis = rho_pollard(num);
	factorize(divis, facts);
	factorize(num/divis, facts);
}
vector<pair<ll,ll>> ml(vector<ll> fact){
  vector<pair<ll,ll>> f;
  if(int(fact.size())==0){
    return f;
  }
  sor(fact);
  ll x=fact[0];
  ll y=1;
  for(int i=1;i<int(fact.size());i++){
    if(x==fact[i]){
      y++;
    }
    else{
      pair<ll,ll> z;
      z.fi=x;
      z.se=y;
      f.push_back(z);
      x=fact[i];
      y=1;
    }
  }
  pair<ll,ll> z;
  z.fi=x;
  z.se=y;
  f.push_back(z);
  return f;
}
bool isp(ll a){
  bool res=true;
  if(a==1){
    return false;
  }
  for(int i=2;i*i<=a;i++){
    if(a%i==0){
      return false;
    }
  }
  return true;
}
int main() {
  /* mod は 1e9+7 */
  ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
  cout<< fixed << setprecision(20);
  ll a,b;
  cin>>a>>b;
  vector<ll> m(1050000);
  m[0]=1;
  vector<ll> prime;
  map<ll,ll> ip;
  vector<ll> check;
  for(int i=2;i<=72;i++){
    if(isp(i)){
      prime.push_back(i);
    }
  }
  check.push_back(0);
  for(ll i=a;i<=b;i++){
    ll f=0;
    for(int j=0;j<20;j++){
      if(i%prime[j]==0){
        f+=(1<<j);
      }
    }
    for(int j=0;j<int(check.size());j++){
      bool t=true;
      if((check[j]&f)==0){
        if(m[check[j]+f]==0){
          check.push_back(check[j]+f);
        }
        m[check[j]+f]+=m[check[j]];
      }
    }
  }
  ll ans=0;
  for(int i=0;i<1050000;i++){
    ans+=m[i];
  }
  cout<<ans<<endl;
}
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N=(1<<20);
bool vis[80];
int prime[25],cnt;
ll dp[N];
void init(){
    int maxn=72;
    cnt=0;
    for(int i=2;i<=maxn;i++){
        if(!vis[i])
            prime[++cnt]=i;
        for(int j=1;j<=cnt&&prime[j]*i<=maxn;j++){
            vis[i*prime[j]]=1;
            if(i%prime[j]==0)
                break;
        }
    }
}
int main(){
    init();
    ll a,b;
    scanf("%lld%lld",&a,&b);
    dp[0]=1;//空集
    for(ll i=a;i<=b;i++){
        int msk=0;
        for(int j=1;j<=cnt;j++){//得到i含有的质因子
            if(i%prime[j]==0)
                msk|=(1<<(j-1));
        }
        for(int j=0;j<(1<<cnt);j++){
            if(!(msk&j))//表示两个状态互质
                dp[msk|j]+=dp[j];
        }
    }
    ll ans=0;
    for(int i=0;i<(1<<cnt);i++) 
        ans+=dp[i];
    printf("%lld\n",ans);
    return 0;
}