#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline ll floorsqrt(ll x) { ll ok = 0, ng = 1e9 + 1; while (abs(ng - ok) > 1) { ll mid = (ok + ng) / 2; (mid * mid <= x ? ok : ng) = mid; } return ok; } int main() { ll x, y; cin >> x >> y; cout << floorsqrt(4 * (x * x + y * y)) + 1 << endl; return 0; }