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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split();
            double x1 = double.Parse(str[0]);
            double y1 = double.Parse(str[1]);
            string[] str1 = Console.ReadLine().Split();
            double x2 = double.Parse(str1[0]);
            double y2 = double.Parse(str1[1]);
            int br = 0;
            if(x1==x2||y1==y2)
            {
                br = 2;
            }
            else 
            if(Math.Abs(x1-x2)==Math.Abs(y1-y2))
            {
                br = 1;
            }
            Console.WriteLine(br);
        }
    }
}