#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef uint64_t ull; typedef pair P; constexpr double PI = 3.1415926535897932; // acos(-1) constexpr double EPS = 1e-9; constexpr int INF = 1001001001; constexpr int mod = 1000000007; // constexpr int mod = 998244353; #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define chadd(x, y) x = (x + y) % mod int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int d1, d2; cin >> d1 >> d2; double lb = sqrt(d2 * 2) / 2; double ub = sqrt(d2); double r = sqrt(d1); if(r < lb || r > ub) cout << 0 << endl; else if(r == lb || r == ub) cout << 4 << endl; else cout << 8 << endl; }