#include using namespace std; int32_t main() { int d1, d2; cin >> d1 >> d2; if (d1 == d2 || 2 * d1 == d2) { cout << 4 << endl; } else if (d1 < d2 && d2 < 2 * d1) { cout << 8 << endl; } else { cout << 0 << endl; } }