#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;
} 

#include <bits/stdc++.h>
using namespace std;
template <class T> inline void read(T &x) {
	x= 0;
	char c= getchar();
	while(!isdigit(c)) c= getchar();
	while(isdigit(c)) x= x * 10 + (c & 15), c= getchar();
}
#define N 74
int n, prime[]= {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71}, p[N];
long long a, b, t[N], f[1 << 20], ans;
signed main() {
	read(a), read(b);
	for(long long i= a; i <= b; i++) t[++n]= i;
	for(int i= 1; i <= n; i++)
		for(int j= 0; j < 20; j++)
			if(t[i] % prime[j] == 0) p[i]|= 1 << j;
	f[0]= 1;
	for(int j= 1; j <= n; j++)
		for(int i= 0; i < (1 << 20); i++) {
			if(i & p[j]) continue;
			f[i | p[j]]+= f[i];
		}
	for(int i= 0; i < (1 << 20); i++) ans+= f[i];
	printf("%lld", ans);
	return 0;
}