#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; using P = pair; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; signed main() { int d[2]; cin >> d[0] >> d[1]; if(d[0] * 4 < d[1]){ cout << 0 << endl; }else if(d[0] * 4 == d[1]){ cout << 4 << endl; }else if(d[0] < d[1]){ cout << 8 << endl; }else if(d[0] == d[1]){ cout << 4 << endl; }else{ cout << 0 << endl; } return 0; }