#include <iostream>

inline float abs(float val)
{
	return val < 0 ? -val : val;		
}

int main()
{
	float x1, y1, x2, y2;

	std::cin >> x1 >> y1 >> x2 >> y2;

	if (x1 == x2 || y1 == y2)
		std::cout << 2;
	else if (abs(x1 - x2) == abs(y1 - y2))
		std::cout << 1;
	else
		std::cout << 0;
	return 0;
}