#include <cstdio>
#include <cmath>
#include <algorithm>

#ifdef WIN32
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

#define EPS (1e-9)

long long sqr(long long x) {
    return x * x;
}

long long calc(long long x) {
    if (x < 0)
        return 0;
    x /= 36000;
    if (!x)
        return 1;
    long long root = floor(pow(x, 1.0 / 6) + EPS);
    return root + 1;
}

int main() {
    freopen("exam.in", "r", stdin);
    freopen("exam.out", "w", stdout);
    long long l, r;
    scanf(LLD LLD, &l, &r);
    printf(LLD"\n", calc(r) - calc(l - 1));
    return 0;
}                    