#include "iostream";

using namespace std;

int main(){
	long long x1, x2, y1, y2;
	
	cin >> x1 >> y1 >> x2 >> y2;
	
	double a =  ((double)y1-(double)y2)/((double)x1-(double)x2);
	
	if(a == 0 || a == ((double)(-1))/(double)0 || a == ((double)1)/(double)0)
		cout << 2;
	else if(a == 1)
		cout << 1;
	else
		cout << 0;
	
	return 0;
}