#include using namespace std; int cnt[10000100]; int main(void){ int x, y; cin >> x >> y; int ans = 0; for(int i = 0; i * i <= y; i++){ for(int j = 1; i * i + j * j <= y; j++){ if(i * i + j * j >= x){ cnt[i * i + j * j]++; ans = max(ans, cnt[i * i + j * j]); } } } cout << 4 * ans << "\n"; }