x, y = [int(x) for x in input().split()] print(int((x**2 + y**2)**0.5 * 2) + 1)