using System;
namespace Kvadrati
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] kor1 = Console.ReadLine().Split(' ');
            string[] kor2 = Console.ReadLine().Split(' ');
            int x1 = int.Parse(kor1[0]);
            int y1 = int.Parse(kor1[1]);
            int x2 = int.Parse(kor2[0]);
            int y2 = int.Parse(kor2[1]);
            if ((x1 != x2) && (y1 != y2))
                Console.WriteLine(1);
            else
                Console.WriteLine(2);
        }
    }
}