#include <iostream>
#include<algorithm> 
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;


int main()
{
    long long x1, y1, x2, y2;
	double distanca, stranicax, stranicay,stranica;

	cin >> x1 >> y1;
	cin >> x2 >> y2;

	if (x1 == x2 || y1 == y2)
	{
		cout << "2" << endl;
	}

	else
	{
		if ((x1 > 0 && x2 > 0) || (x1 < 0 && x2<0))
		{
			stranicax = abs(x2 - x1);
		}
		else
		{
			stranicax = abs(x2) + abs(x1);
		} 

		if ((y1 > 0 && y2 > 0) || (y1 < 0 && y2 < 0))
		{
			stranicay = abs(y2 - y1);
		}
		else
		{
			stranicay = abs(y2) + abs(y1);
		}

		if (stranicax == stranicay)
		{
			cout << "1" << endl;
		}
		else
		{
			cout << "0" << endl;
		}
	}
}