using System;
public class Program
{
	public static void Main(String[] args)
	{
        string[] tokens = Console.ReadLine().Split();
        int x1 = int.Parse(tokens[0]);
        int y1 = int.Parse(tokens[1]);
        tokens = Console.ReadLine().Split(' ');
        int x2 = int.Parse(tokens[0]);
        int y2 = int.Parse(tokens[1]);
		int k = (y2 - y1) / (x2 - x1);
		if ((x1 == x2) || (y1 == y2))
		{
			Console.WriteLine("2");
		}
		else
		{
			switch (k)
			{
				case -1:
					Console.WriteLine("1");
					break;
				case 1:
					Console.WriteLine("1");
					break;
				default:
                        Console.WriteLine("0");
					break;
			}
		}
	}
}