#include<iostream>
#include<cmath>
#include<cstdlib>
using namespace std;
main()
{
	long long int x1, y1, x2, y2;
	cin >> x1 >> y1;
	cin >> x2 >> y2;
	if(x1 == x2 && y1 == y2)
		cout << 0;
	else if(llabs (x1) == llabs (x2))
		cout << 2;	
	else if(llabs (y1) == llabs (y2))
		cout << 2;	
	else
	{
		if(llabs(x1 - x2) == llabs(y1 - y2))
			cout << 1;
		else
			cout << 0;
	}
	return 0;
}