#include<bits/stdc++.h>
// #include<atcoder/all>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
// using namespace atcoder;
typedef long long int ll;
typedef long double ld;
typedef long long lint;
const ll INF=(1LL<<62);
const ll LINF=(1LL<<62);
const ld pi=acosl((ld)-1);
const ll mod = 1000000007;
// const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"
#define TO_STRING(VariableName) # VariableName

template <typename T>ostream &operator<<(ostream &out,const vector<T> &v) {rep(i,(int)v.size()-1)cout<<v[i]<<" ";cout<<v[(int)v.size()-1];return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const map<T1, T2> &p) {out << "(" << p.first << ", " << p.second << ")";return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const pair<T1, T2> &p){out << "(" << p.first << ", " << p.second << ")";return out;}
template<class T>void debag(const T &obj){cout<<obj<<endl;}

bool solve(){
    ll A,B;cin>>A>>B;

    const ll num=20;

    ll primes[num]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71};
    // ll primes[num]={2,3};
    ll n=B-A+1;
    vector<int>G(n);

    rep(i,n)rep(j,num){
        if((A+i)%primes[j]==0){
           G[i]+=(1LL<<j);
        }
    }

    vector<vector<ll>>dp(n+1,vector<ll>((1LL<<num),0));

    dp[0][0]=1;
    
    rep(i,n)rep(j,(1LL<<num)){
        dp[i+1][j]+=dp[i][j];

        //使える？
        if(G[i] & j)continue;
        dp[i+1][G[i] | j]+=dp[i][j];
    }

    ll ans=0;
    // rep(i,n+1)cout<<dp[i]<<endl;
    rep(j,(1LL<<num))ans+=dp[n][j];

    cout<<ans<<endl;

    // cout<<(2 | 3)<<endl;

    

    return false;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout<<fixed<<setprecision(30);
    // ll T;cin>>T; 
    // rep(i,T){
    //     cout<<"Case #"<<i+1<<" : ";solve();
    // }
    solve();   
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int gcd(int a, int b){
	if(b == 0) return a;
	return gcd(b, a % b);
}

int main() {
  int N,W;
  cin >> N >> W;
  if(N%W == 0){
    cout << N/W;  
  } else {
    cout << (N-N%W)/W;
  }
}