import math x, y = map(int, input().split()) D = int(math.sqrt(x ** 2 + y ** 2) * 2) while True: if (x ** 2 + y ** 2) * 4 < D ** 2: print(D) break D += 1