import math x, y = map(int,input().split()) r = math.ceil(math.sqrt(x*x + y*y)) ans = int(2 * r) if 2 * math.sqrt(x*x + y*y) == ans: ans += 1 print(ans)