import math x,y = map(float, raw_input().split()) r = math.sqrt(x*x+y*y) if r - int(r) == 0: print 2 * int(r) + 1 else: print 2 * (int(r) + 1)