#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; typedef pair P; const ll mod = 1000000007; //ansを出力する時は (ans % mod + mod) % mod とする(負の剰余を正にする) const int inf = 1e9; const long long INF = 1LL << 60; // INFの値は1152921504606846976 int main() { int d1,d2; cin >> d1 >> d2; if(2 * d1 < d2){ cout << 0 << endl; }else if(2 * d1 == d2){ cout << 4 << endl; }else if(d1 < d2) { cout << 8 << endl; }else if(d1 == d2){ cout << 4 << endl; }else{ cout << 0 << endl; } }