#include <stdio.h>



int main(){

	double x1,y1,x2,y2;

	scanf("%lf", &x1);
	scanf("%lf", &y1);
	scanf("%lf", &x2);
	scanf("%lf", &y2);

	if(x1 == y1 && x2 == y2){
	 printf("%d",1);
	}
	else if(x1 == x2 ||  y1 == y2){
	printf("%d",2);
    }
	else{
	printf("%d", 0);
	}
	return 0;
}