a, b = map(int, input().split()) c = (a**2 + b**2) ** 0.5 print(int(c*2) + 1)