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