print((function (x, y) local i,f=math.modf(math.sqrt(math.abs(x)^2+math.abs(y)^2)) return (f==0 or f*2<1) and i*2+1 or i*2+2 end)(io.stdin:read("*n"), io.stdin:read("*n")))