Gx, Gy = gets.split.map(&:to_i) if [Gx, Gy] == [0, 0] p 0 elsif Gx == 0 or Gy == 0 or Gx == Gy or Gx == -Gy p 1 else p 2 end