import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int X = scan.nextInt(); int Y = scan.nextInt(); scan.close(); if(X == Y) { System.out.println(0); }else if(Y == 0) { System.out.println(1); }else if(X == 0) { System.out.println(2); }else if(X == -Y) { System.out.println(3); }else { System.out.println(-1); } } }