#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int kvadrat(double x1, double y1, double x2, double y2){
	if(x1 == x2 || y1 == y2) return 2;
	else if(labs(x1-x2) == labs(y1-y2)) return 1;
	else return 0;
}
int main(int argc, char** argv) {
	double x1,x2,y1,y2;
	cin>>x1>>y1;
	cin>>x2>>y2;
	cout<<kvadrat(x1,y1,x2,y2);
	return 0;
}