#include<iostream>
using namespace std;
int main()
{
	int x1,y1,x2,y2,x,y;
	cin>>x1>>y1>>x2>>y2;
	x=x1-x2;
	y=y1-y2;
	if(x==0||y==0){
		cout<<2<<"\n";
		return 0;
	}
	if(x*y<0)x=-x;
	if(x==y){
		cout<<1<<"\n";
		return 0;
	}
	else cout<<0<<"\n";
	
	return 0;
}