#include<iostream>
#include<cmath>
using namespace std;

int square (int x){
	x = x*x;
	return x;
}

int main(){
	int x1,y1,x2,y2,a,b;
	cin >> x1 >> y1 >> x2 >> y2;
	if (x1 == x2 and y1 == y2){
		cout << 4;
	}
	else {
		if (x1 == x2 or y1 == y2){
		    cout << 2;
	    }
	    else {
		    a = sqrt(square(x2-x1)+square(y1-y1));
		    b = sqrt(square(x2-x2)+square(y2-y1));
		    if (a == b){
			    cout << 1;
		    }
		    else {
			    cout << 0;
		}
	}
}
}