//{{{
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VLL = vector<LL>;
using vi = vector<int>;
using pii = pair<int, int>;
#define sz(x) (int)((x).size())
#define all(x) (x).begin(), (x).end()
#define clr(a, b) memset(a, b, sizeof(a))
#ifdef LOCAL
#include "prettyprint.hpp"
// clang-format off
void _print() { cerr << "]\033[0m\n"; }
template <typename T> void __print(T x) { cerr << x; }
template <typename T, typename... V> void _print(T t, V... v) { __print(t); if (sizeof...(v)) cerr << ", "; _print(v...); }
#define debug(x...) cerr << "\033[1;34m[" << #x << "] = \033[1;32m["; _print(x)
#define debug_arr(x...) cerr << "\033[1;34m[" << #x << "] = \033[1;32m" << (x) << "\033[0m\n"
#else
#define debug(x...)
#define debug_arr(x...)
#endif
// clang-format on
//}}}

int prm[20] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71};
LL a, b;

LL dp[2][1 << 20];

int main()
{
#ifdef LOCAL
    freopen("in", "r", stdin);
    // freopen("out", "w", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    while (cin >> a >> b)
    {
        int cur = 0;
        clr(dp[cur], 0);
        dp[cur][0] = 1;
        for (LL i = a; i <= b; i++)
        {
            memcpy(dp[cur ^ 1], dp[cur], sizeof(dp[cur]));
            int mask = 0;
            for (int j = 0; j < 20; j++)
                if (i % prm[j] == 0) mask |= (1 << j);

            for (int pres = 0; pres < (1 << 20); pres++)
            {
                if ((pres & mask) != 0) continue;
                dp[cur ^ 1][pres | mask] += dp[cur][pres];
            }
            cur ^= 1;
        }

        LL ans = 0;
        for (int i = 0; i < (1 << 20); i++) ans += dp[cur][i];
        cout << ans << endl;
    }

    return 0;
}

#include <vector>
#include <iostream>

#define int         long long
#define double      long double
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

signed main() {
    tezz

    vector<int> primes;
    for (int i = 2; i < 72; i++) {
        bool flag = true;
        for (int j = 2; j < i; j++) {
            if (i % j == 0) flag = false;
        }
        if (flag) primes.emplace_back(i);
    }

    int A, B;
    cin >> A >> B;
    vector<int> v(B - A + 1);
    for (int i = A; i <= B; i++) {
        int mask = 0;
        for (int j = 0; j < primes.size(); j++) {
            if (i % primes[j] == 0) {
                mask |= (1 << j);
            }
        }
        v[i - A] = mask;
    }

    vector<int> dp(1<<primes.size());
    dp[0] = 1;
    for (int x: v) {
        for (int mask = 0; mask < (1 << primes.size()); mask++) {
            if (dp[mask]&&(mask & x)==0) {
                dp[mask ^ x] += dp[mask];
            }
        }
    }

    int ans = 0;
    for (int i = 0; i < (1 << primes.size()); i++) ans += dp[i];
    cout << ans;
}