#include <iostream>
#include <cmath>

using namespace std;

int main() {
	double ax,ay,by,bx,k=0;
	cin >> ax >> ay;
	cin >> bx >> by;
	if((ax==bx && ay!=by)||(ax!=bx && ay==by)) k=2;
	else if(abs(ax-bx) == abs(ay-by)) k=1;
	cout << k;
	return 0;
}