#include <stdio.h>
#include <math.h>
int main(){
	double x1,x2,y1,y2,refx,refy;
	double distance1,distance2;
	scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2);
		
	refy=y2;

	refx=x1;
	
	distance1 = sqrt(((refx-x1)*(refx-x1))+((refy-y1)*(refy-y1)))* sqrt(2);
	distance2 = sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));
	if(x1==x2 || -x1==x2 || x1==-x2){
		printf("%d",2);
	}
	else if(y1==y2 || -y1==y2 || y1==-y2){
		printf("%d",2);
	}
	else if(distance1 == distance2){
		printf("%d",1);
	}
	else{
		printf("%d",0);
	}
	
	return 0;
}