#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using cd = complex<ld>;

vector<int> primes({2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71});

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  vector<ll> dp(1 << primes.size());
  ll a, b;
  cin >> a >> b;
  dp[0] = 1;
  for (; a <= b; a++) {
    auto dp2 = dp;
    int curMask = 0;
    for (int i = 0; i < primes.size(); i++) {
      if (a % primes[i] == 0) {
        curMask |= 1 << i;
      }
    }
    for (int mask = 0; mask < dp.size(); mask++) {
      if ((curMask & mask) == 0) {
        dp2[curMask | mask] += dp[mask];
      }
    }
    dp = dp2;
  }
  cout << accumulate(dp.begin(), dp.end(), 0LL);
  return 0;
}

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

//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


#define pb push_back
#define fi first
#define se second
#define ll long long
#define tp top()
#define fr front()
#define vi vector<int>
#define sz size()
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define mem(a,  b) memset(a,  (b),  sizeof(a))
#define clr(a) memset(a,  0,  sizeof(a))
#define sqr(x) ( (x) * (x) )
#define all(v) v.begin(),  v.end()

typedef pair<int, int> pii;
typedef pair<int,pii> pip;
typedef pair<pii,int> ppi;
typedef pair<pii,pii> ppp;



void base(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}


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

void solve(){
	ll a,b;
	cin>>a>>b;
	for(ll i=a;i<=b;i++){
		for(ll j=0;j<20;j++){
			if (i%primes[j] == 0) bit[i-a] |= (1<<j);
		}
	}
	
	trans[0] = 1;
	
	for(ll i=a;i<=b;i++){
		for(ll j=(1<<20)-1; j>=0; j--){
			if ((bit[i-a] & j)!= bit[i-a])	continue;
			ll bt = j ^ bit[i-a];
			trans[j] += trans[bt];
		}
	}		
	ll sum = 0;
	rep(i,0,(1<<20)) sum+=trans[i];
	cout<<sum<<"\n";
}

int main()
{
	base();
//  freopen("input.txt", "r", stdin);
//  freopen("output.txt", "w", stdout);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}




