import math X, Y = map(int, input().split()) r = (X**2 + Y**2) ** 0.5 print([math.ceil(r*2), int(r*2)+1][r*2 == int(r*2)])