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

namespace kvadrati
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s1 = Console.ReadLine().Split(' ');
            string[] s2 = Console.ReadLine().Split(' ');
            int r = 0;
            double x1 = double.Parse(s1[0]);
            double y1 = double.Parse(s1[1]);
            double x2 = double.Parse(s2[0]);
            double y2 = double.Parse(s2[1]);
            if (y1 == y2 && x1 != x2 || x1 == x2 && y1 != y2) r = 2;
            if (x1 == x2 && y1 == y2) r = 4;
            if (Math.Abs(x1 - x2) == Math.Abs(y1 - y2)) r = 1;
            Console.WriteLine(r.ToString());

            

        }
    }
}