from math import ceil x, y = map(int, input().split()) r = (x**2 + y**2) ** 0.5 * 2 print(ceil(r) + (1 if r == ceil(r) else 0))