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