fn main() { let mut xy = String::new(); std::io::stdin().read_line(&mut xy).ok(); let mut xy: Vec = xy.trim().split_whitespace() .map(|e| e.parse().unwrap()).collect(); let ans = if xy[0] == xy[1] { 0 } else if xy[0] == 0 { 2 } else if xy[1] == 0 { 1 } else if xy[0] == -xy[1] { 3 } else { -1 }; println!("{}", ans); }