#include <iostream>
using namespace std;
int main(int argc, char** argv) {
	int x,x1,y,y1,answ;
	cin>>x>>x1>>y>>y1;
	if(x1=y1 || x=y){
		answ=2;
	} else if ((y1-x1)==(y-x)) {
		answ=1;
	} else {
		answ=0;
	}
	cout<<answ;
}