import math x, y = map(int, input().split()) #直径 l = 2 * (x ** 2 + y ** 2) ** 0.5 if l.is_integer(): print(int(l) + 1) else: print(math.ceil(l))