#include using namespace std; using ll = long long; using ld = long double; using P = pair; using vi = vector; using vvi = vector>; using vll = vector; using vvll = vector>; const ld eps = 1e-9; const ll MOD = 1000000007; const int INF = 1000000000; const ll LINF = 1ll<<50; template void printv(const vector& s) { for(int i=0;i<(int)(s.size());++i) { cout << s[i]; if(i == (int)(s.size())-1) cout << endl; else cout << " "; } } template ostream& operator<<(ostream &os, const pair p) { os << p.first << ":" << p.second; return os; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10); double d1, d3; cin >> d1 >> d3; d1 = sqrt(d1); d3 = sqrt(d3); double d2 = d3 / sqrt(2); if(d3 < d1 + eps) { cout << 0 << endl; } else if(abs(d1 - d3) < eps) { cout << 4 << endl; } else if(d2 - eps < d1 && d1 < d3 + eps) { cout << 8 << endl; } else if(abs(d1 - d2) < eps) { cout << 4 << endl; } else { cout << 0 << endl; } }