print((function (x, y) local r=math.sqrt(math.abs(x)^2+math.abs(y)^2) return r==math.floor(r) and 2*r+1 or 2*math.ceil(r) end)(io.stdin:read("*n"), io.stdin:read("*n")))