using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Z1
{
    class Program
    {
        static void Main(string[] args)
        {
            string tacka1 = Console.ReadLine();
            string tacka2 = Console.ReadLine();

            string[] kord1 = tacka1.Split(' ');
            string[] kord2 = tacka2.Split(' ');

            int x1 = int.Parse(kord1[0]);
            int y1 = int.Parse(kord1[1]);

            int x2 = int.Parse(kord2[0]);
            int y2 = int.Parse(kord2[1]);

            if (x1 != x2 && y1 != y2)
            {
                Console.Write(1);
            }
            else {
                Console.Write(2);
            }
            Console.ReadKey();
        }
    }
}