a, b = io.read("*n", "*n") if a == 0 and b == 0 then print(0) elseif a == 0 or b == 0 or a == b or a == -b then print(1) else print(2) end