#include using ll = long long; using namespace std; const int INFint = 1e9+1; const ll INFll = (ll)1e18+1; ll MOD=1e9+7; int cnt[10000001] = {0}; int main(){ ll x,y; cin>>x>>y; for(int i(0);i<4000;i++){ for(int j(0);j<4000;j++){ ll x = i*i+j*j; if(x <= 10000000){ cnt[x]++; } } } int ans(0); for(int i(x);i<=y;i++){ if((int)sqrt(i)*(int)sqrt(i) == i) ans = max(ans,(cnt[i]-1)*4); else ans = max(ans,cnt[i]*4); } cout << ans << endl; return 0; }