#include using namespace std; #define repd(i,a,b) for (int i=(a);i<(b);++i) #define rep(i,n) repd(i,0,n) typedef long long ll; int main(){ int d1, d2; cin >> d1 >> d2; if(d2 < d1){ cout << 0 << endl; }else if(d2 == d1){ cout << 4 << endl; }else if(d2 / 2 == d1){ cout << 4 << endl; }else if(d2 / 2 > d1){ cout << 0 << endl; }else{ cout << 8 << endl; } return 0; }