fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let v: Vec = s.split_whitespace().flat_map(str::parse).collect(); println!( "{}", match v.as_slice() { [_, 0] => 1, [-1, _] => 2, _ => -1, } ) }