import math xp, yp = [int(x) for x in input().split()] res = 0 r2 = 4 * xp * xp + yp * yp r_can = int(math.floor(math.sqrt(r2))) for r in range(r_can, 4 * 10**4): if r * r > r2: res = r break print(res)