x, y = map(int, input().split()) l, r = 0, 50000 while r - l > 1: mid = (l + r) // 2 if (mid / 2)**2 > x**2 + y**2: r = mid else: l = mid print(r)