#include using namespace std; using PP = pair; const int INF = 1e9; template T Next() { T t; cin >> t; return t; } int a[10000001]; int main() { for (int i = 0; i < 3200; ++i) { for (int j = 1; j < 3200; ++j) { int k = i * i + j * j; if (k > 10000000) continue; ++a[k]; } } int x, y; cin >> x >> y; int mx = 0; for (int i = x; i <= y; ++i) { mx = max(mx, a[i]); } cout << 4 * mx << endl; }