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[] s = Console.ReadLine().Split();
            string[] n = Console.ReadLine().Split();
            double x1 = double.Parse(s[0]);
            double y1 = double.Parse(s[1]);
            double x2 = double.Parse(n[0]);
            double y2 = double.Parse(n[1]);
            int brojac = 0;
            if (y1 != y2 && x1 != x2)
            {
                double x3 = x2;
                double y3 = y1;
                double x4 = x1;
                double y4 = y2;
                if ((y1 - y4) == (x4 - x2))
                    brojac++;
            }
            else if (y1 != y2 && x1 == x2)
                brojac = brojac + 2;
            else if (y1 == y2 && x1 != x2)
                brojac = brojac + 2;
            Console.WriteLine(brojac);
            Console.ReadLine();
        }
    }
}