using System;

namespace ConsoleApp18
{
	class Program
	{
		static void Main(string[] args)
		{
			int x1, x2, y1, y2;
			string[] unos = Console.ReadLine().Split(' ');
			x1 = int.Parse(unos[0]);
			y1= int.Parse(unos[1]);
			unos = Console.ReadLine().Split(' ');
			x2 = int.Parse(unos[0]);
			y2 = int.Parse(unos[1]);
			if (x1 == x2 || y1 == y2)
			{
				Console.WriteLine("2");
			}
			else
			{
				Console.WriteLine("1");
			}
		}
	}
}