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

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

            string[] m = Console.ReadLine().Split();
            double x2 = double.Parse(m[0]);
            double y2 = double.Parse(m[1]);

            if ((x1 == x2) || (y1 == y2))
                Console.WriteLine("2");
            else if ((x1 - x2) == (y1 - y2))
                Console.WriteLine("1");
            else
                Console.WriteLine("0");
        }
    }
}