import math input_list = list(map(int,input().split())) x, y = input_list res = 0 distance = 2 * math.sqrt(x ** 2 + y ** 2) if math.ceil(distance) == math.floor(distance): res = distance + 1 else: res = math.ceil(distance) print(int(res))