hankei r d2 | r^2 == d2 = r * 2 + 1 | r^2 > d2 = r * 2 | otherwise = hankei (r + 1) d2 main = do str <- getLine let [x,y] = map read $ words str :: [Int] -- 点 d2 = x^2 + y^2 -- 原点からの距離の2乗 print $ hankei 0 d2