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

namespace Zadatak1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split(' ');
            int x1 = Convert.ToInt32(ulaz[0]);
            int y1 = Convert.ToInt32(ulaz[1]);
            ulaz = Console.ReadLine().Split(' ');
            int x2 = Convert.ToInt32(ulaz[0]);
            int y2 = Convert.ToInt32(ulaz[1]);

            if (x1 != x2 && y1 != y2) Console.WriteLine("1");
            else Console.WriteLine("2");
            Console.ReadLine();
        }
    }
}