#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimize("O3") #pragma GCC optimization ("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace __gnu_pbds; const long long int mod1=1000000007; const long long int mod2 = -1; #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define pb push_back #define pp pop_back #define ff first #define ss second #define ll long long int #define ull unsigned long long int #define ordered_set tree,rb_tree_tag,tree_order_statistics_node_update> #define ordered1 tree,rb_tree_tag,tree_order_statistics_node_update> #define inf mod1 #define all(x) x.begin(),x.end() ll gcd(ll a, ll b){ ll c; while(b){ c = b; b = a % b; a = c; } return a; } ll power1(ll a, ll b){ if(b == 0) return 1; else if(b % 2) return a * power1(a, b - 1); else { ll temp = power1(a, b / 2); return temp * temp; } } ll power2(ll a, ll b, ll m){ a %= m; if(b == 0) return 1; else if(b % 2) return (a * power2(a, b - 1, m)) % m; else{ ll temp = power2(a, b / 2, m); return (temp * temp) % m; } } ll mod(ll x, ll p){ return (x % p + p) % p; } ll lcm(ll x, ll y){ return (x * y)/gcd(x, y); } int main(){ fast; ll h = 1; //cin >> h; ll st = 1; while(h--){ ll d1, d2; cin >> d1 >> d2; double x = sqrt(d1); double y = sqrt(d2) / sqrt(2); if(d1 == d2 || d1 == d2 / 2){ cout << 4 << endl; } else if(2 * d1 < d2 || d1 > d2){ cout << 0 << endl; } else{ cout << 8 << endl; } } }