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