using System;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] e = Console.ReadLine().Split();
            int x1 = Convert.ToInt32(e[0]);
            int y1 = Convert.ToInt32(e[1]);
            e = Console.ReadLine().Split();
            int x2 = Convert.ToInt32(e[0]);
            int y2 = Convert.ToInt32(e[1]);
            if (x1 == x2 && y1 == y2) Console.Write("2");
            else Console.Write("1");
        }
    }
}