#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; templatebool chmax(T &a, const T &b) { return (abool chmin(T &a, const T &b) { return (b vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define rep(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< vi; typedef pair pii; int main() { ll X, Y; cin >> X >> Y; X = abs(X); Y = abs(Y); ll R = X*X + Y*Y; for (ll i = 0; i <= 20002; i++) { ll r = i*i; if (r > R) { cout << 2 * i; return 0; } else if (r == R) { cout << 2 * i+1; return 0; } } return 0; }