#include <iostream>
#include <vector>
using namespace std;

int main()
{
    long long A, B;
    cin>>A>>B;

    vector<int> F;
    for (int f=2; f<=72; f++)
    {
        bool ok = true;
        for (int i=2; i<f; i++)
            if (f%i==0)
                ok = false;
        if (ok)
            F.push_back(f);
    }
    int n = (int)F.size();

    vector<long long> T(1<<n);
    T[0] = 1;

    for (long long c=A; c<=B; c++)
    {
        vector<long long> P = T;
        int b = 0;
        for (int i=0; i<n; i++)
            if (c%F[i]==0)
                b |= 1<<i;

        for (int i=0; i<1<<n; i++)
            if ((b&i)==0)
                T[b|i] += P[i];
    }
    long long ans = 0;
    for (long long t: T)
        ans += t;
    cout<<ans<<endl;
}

#include <algorithm>
#include <iostream>
#include <deque>
#include <climits>
#include <cmath>
#include <cstring>
#include <map>
#include <set>
#include <vector>

// #include <atcoder/convolution>

using namespace std;
using ll = long long;
#define len(s) static_cast<ll>(s.size())
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(c) c.begin(), c.end()

template<typename T, const char* fmt>
struct INPUT {
    T value;
    INPUT() { scanf(fmt, &value); }
    operator T() { return value; }
};
const char IC_FMT[] = "%c";
const char ILL_FMT[] = "%lld";
using CHAR = INPUT<char, IC_FMT>;
using LL = INPUT<ll, ILL_FMT>;

template<typename S>
std::ostream &operator<<(std::ostream &os, const vector<S> &vec) {
    auto size = len(vec);
    rep(i, size) {
        cout << vec[i];
        if (i < size - 1) cout << ' ';
    }
    return cout;
}

template<typename S, typename T>
std::ostream &operator<<(std::ostream &os, const pair<S, T> &pair) {
    return cout << pair.first << ' ' << pair.second;
}

template <typename T>
void print(T t) {
    cout << t << endl;
}

template <typename T, typename S, typename... Args>
void print(T t, S s, Args... args) {
    cout << t << ' ';
    print(s, args...);
}

template<typename... Args>
void debug(Args... args) {
    #ifndef NDEBUG
    cout << "\x1b[1;32m";
    print(args...);
    cout << "\x1b[0m";
    #endif
}

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

const vector<ll> pr_list = {
    2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
    31, 37, 41, 43, 47, 53, 59, 61, 67, 71};

ll dp[74][1 << 20];

int main() {
    LL A, B;
    debug(A, B);

    ll mask[73];
    for (ll i = A; i <= B; i++) {
        mask[i - A] = 0;
        rep(j, 20) {
            if (i % pr_list[j] == 0) {
                mask[i - A] |= 1 << j;
            }
        }
    }

    memset(&dp, 0, sizeof(dp));
    dp[0][0] = 1;

    for (ll i = A; i <= B; i++) {
        rep(j, 1 << 20) {
            if (!(j & mask[i - A])) {
                dp[i - A + 1][j | mask[i - A]] += dp[i - A][j];
            }
            dp[i - A + 1][j] += dp[i - A][j];
        }
    }

    ll count = 0;
    rep(j, 1 << 20) {
        count += dp[B - A + 1][j];
    }
    print(count);
    return 0;
}
