//#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef long double ld; typedef pair Pii; typedef pair Pil; typedef pair Pll; typedef pair Pli; const ll MOD = 1e9 + 7; const ll MOD2 = 998244353; const ll INF = 1ll << 60; const double PI = 2 * asin(1); int main(){ int C, D; cin >> C >> D; D/=2; if (C == D){ cout << 4 << endl; }else if (C > D){ cout << 8 << endl; }else{ cout << 0 << endl; } return 0; }