#include <bits/stdc++.h>
#define show(x) std::cerr << #x << " = " << (x) << std::endl
using ll = long long;
using ld = long double;
constexpr ll MOD = 1000000007LL;
template <typename T>
constexpr T INF() { return std::numeric_limits<T>::max() / 16; }
std::mt19937 mt{std::random_device{}()};
int main()
{
    ll X, Y;
    std::cin >> X >> Y;
    std::vector<int> ans(10000001, 0);
    for (int y = -4000; y <= 4000; y++) {
        for (int x = -4000; x <= 4000; x++) {
            if (x * x + y * y <= 10000000) { ans[x * x + y * y]++; }
        }
    }

    int max = 0;
    for (int i = X; i <= Y; i++) { max = std::max(max, ans[i]); }
    std::cout << max << std::endl;
    return 0;
}