#include #include using namespace std; int main() { int r, v; cin >> r >> v; r = sqrt(r); if(r == v*2) cout << 4 << endl; else if(r < v*2) cout << 0 << endl; else cout << 8 << endl; }