#pragma GCC optimize ("O3") #include "bits/stdc++.h" using namespace std; using ll = long long int; const ll h = 10000000; ll m[h+10]; int main(){ int a, b; cin >> a >> b; for (ll x = 0; x<=4000; ++x) for (ll y = 0; y<=4000; ++y) if (x*x+y*y <= h) m[x*x+y*y]+=4; ll best = 0; for (int c = a; c<=b; ++c) best = max(best, m[c]); cout << best << endl; return 0; }