# coding : utf-8 A, B = gets.split(' ').map{|s|s.to_i} if B == 0 then p 1 elsif A == -1 then p 2 else p -1 end