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

namespace KvadratiTakmcienje
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            int x1 = int.Parse(str[0]);
            int y1= int.Parse(str[1]);

            str = Console.ReadLine().Split();
            int x2 = int.Parse(str[0]);
            int y2 = int.Parse(str[1]);

            if (x1!=x2 && y1!=y2)
            {
                if (Math.Abs(x1-x2) == Math.Abs(y1-y2))
                {
                    Console.WriteLine(1);
                }
                else
                {
                    Console.WriteLine(0);
                }
            }
            else
            {
                Console.WriteLine("2");
            }

        }
    }
}