#include using ll = long long; using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int d1,d2; cin >> d1 >> d2; if (d1*2 == d2 || d1 == d2) cout << "4\n"; else if (d1*2 < d2 || d1 > d2) cout << "0\n"; else cout << "8\n"; return 0; }