import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int y = sc.nextInt(); int ans = -1; if(x == y) { ans = 0; } else if(y == 0) { ans = 1; } else if(x == 0) { ans = 2; } else if((x + y) == 0) { ans = 3; } System.out.println(ans); } }