#include #include using namespace std; int A[10000010]; int main(){ int x,y;cin>>x>>y; for(int i = 1; 4000 > i; i++){ for(int j = 0; 4000 > j; j++){ if(x <= i*i+j*j && i*i+j*j <= y)A[i*i+j*j]++; } } int ans = 0; for(int i = x; y >= i; i++)ans = max(ans,A[i]); cout << ans*4 << endl; }