using System;
using System.Collections.Generic;
using System.Linq;
namespace Treci
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] red, red2;
            int x1, y1, x2, y2;
            Console.WriteLine("Unesi koordinate prve tacke.");
            red = Console.ReadLine().Split();
            x1 = int.Parse(red[0]);
            y1 = int.Parse(red[1]);
            Console.WriteLine("Unesi koordinate druge tacke.");
            red2 = Console.ReadLine().Split();
            x2 = int.Parse(red2[0]);
            y2 = int.Parse(red2[1]);
            if ((x1 == x2) || (y1 == y2))
            { Console.WriteLine("2"); }
            else
            { Console.WriteLine("1"); }
        }
    }
}