import numpy as np x, y = map(int,input().split()) r = np.sqrt(x**2+y**2) if 2*r == int(2*r): print(int(2*r+1)) else: print(int(2*r)+1)