#include <stdio.h>
#include <stdlib.h>
int main()
{
	long long x1, x2, y1, y2;
	scanf("%lld %lld", &x1, &y1);
	scanf("%lld %lld", &x2, &y2);
	if(x1 == x2 && y1 == y2){
		printf("0");
		return 0;
	}else if(x1 == x2 || y1 == y2){
		printf("2");
		return 0;
	}
	else if(abs(x1 - x2) == abs(y1 - y2)){
		printf("1");
		return 0;
	}else{
		printf("0");
	}
	
	return 0;
}