using System;

namespace _1_kvadrati
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] A = Console.ReadLine().Split(' ');
            string[] B = Console.ReadLine().Split(' ');

            double Ax = Convert.ToDouble(A[0]);
            double Ay = Convert.ToDouble(A[1]);

            double Bx = Convert.ToDouble(B[0]);
            double By = Convert.ToDouble(B[1]);

            if ((Ax == Bx) || (Ay == By))
            {
                Console.WriteLine(2);
            }
            else
            if ((Ax - Bx) - (Ay - By) == 0)
            {
                Console.WriteLine(1);
            }
            else
            {
                Console.WriteLine(0);
            }
        }
    }
}