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

namespace Kvadrati
{
    class Program
    {
        static void brKvadrata(int x1, int y1, int x2, int y2)
        {
            if (x1 == x2 || y1 == y2)
                Console.WriteLine("2");
            else
                Console.WriteLine("1");
        }
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split();
            int x1 = int.Parse(ulaz[0]);
            int y1 = int.Parse(ulaz[1]);
            string[] ulaz1 = Console.ReadLine().Split();
            int x2 = int.Parse(ulaz1[0]);
            int y2 = int.Parse(ulaz1[1]);
            brKvadrata(x1, y1, x2, y2);
            Console.ReadKey();
        }
    }
}