using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { String line = Console.ReadLine(); String[] s = line.Split(' '); int X = int.Parse(s[0]); int Y = int.Parse(s[1]); if (X == Y) Console.WriteLine(0); else if (X == 0) Console.WriteLine(2); else if (Y == 0) Console.WriteLine(1); else if(X == -Y) { if (X < 0) Console.WriteLine(3); else Console.WriteLine(1); } else Console.WriteLine(-1); } } }