from math import ceil Px, Py = map(int, raw_input().split()) OP = (Px**2 + Py**2) ** 0.5 R = ceil(OP) if OP%1 == 0: ans = 2*R + 1 else: ans = 2*R print int(ans)