static void Main(string[] args)
        {
            string[] niz1 = Console.ReadLine().Split(" ");
            string[] niz2 = Console.ReadLine().Split(" ");
            if (niz1[0] == niz2[0])
            {
                Console.WriteLine(2);
            }
            if (niz1[1] == niz2[1])
            {
                Console.WriteLine(2);
            }
            if (niz1[0] != niz2[0] && niz1[1] != niz2[1])
            {
                double x1, x2, y1, y2;
                x1 = Convert.ToDouble(niz1[0]);
                y1 = Convert.ToDouble(niz1[1]);
                x2 = Convert.ToDouble(niz2[0]);
                y2 = Convert.ToDouble(niz2[1]);
                if (Math.Abs(x1 - x2) == Math.Abs(y1 - y2))
                    Console.WriteLine(1);
                else
                    Console.WriteLine(0);

            }
        }