#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#include <ext/rope>
using namespace __gnu_cxx;

typedef tree<long long, null_type, less<long long>,
rb_tree_tag, tree_order_statistics_node_update> pbds;
//less_equal for identical elements

#define DEBUG

#ifdef DEBUG
#define debug(...) printf(__VA_ARGS__);
#else
#define debug(...)
#endif
#define fi first
#define se second
#define pb emplace_back
#define sz(x) (int)x.size()
#define mnto(x,y) x=min(x,(__typeof__(x))y)
#define mxto(x,y) x=max(x,(__typeof__(x))y)
#define INF 1023456789
#define LINF 1023456789123456789
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
typedef tuple<int, int, int, int> iiii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vll;

int primes[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};
ll a,b,n,arr[80],memo[80][1500000];

ll dp(int x,int msk){
	if(x==n)return 1;
	if(memo[x][msk]!=-1)return memo[x][msk];
	int nmsk=msk;
	for(int i=0;i<20;++i){
		if(arr[x]%primes[i]==0){
			if(msk&(1<<i))return memo[x][msk]=dp(x+1,msk);
			nmsk|=(1<<i);
		}
	}
	return memo[x][msk]=dp(x+1,nmsk)+dp(x+1,msk);
}

int main(){
	scanf("%lld%lld",&a,&b);
	n=b-a+1;
	for(int i=0;i<n;++i){
		arr[i]=i+a;
	}
	memset(memo,-1,sizeof memo);
	printf("%lld\n",dp(0,0));
}

#include <bits/stdc++.h>
using namespace std;
const int N=73;
typedef long long ll;
int n=21;
ll a,b,ans,f[1<<21];
int p[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73};
int main()
{
	f[0]=1;
	scanf("%lld%lld",&a,&b);
	for(ll i=a;i<=b;++i)
	{
		int u=0;
		for(int j=0;j<n;++j)
			if(i%p[j]==0)u|=1<<j;
		for(int j=0;j<1<<n;++j)
			if(!(u&j))f[u|j]+=f[j];
	}
	for(int i=0;i<1<<n;++i)ans+=f[i];
	printf("%lld\n",ans);
}
