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