#include <bits/stdc++.h>
using namespace std;

int main()
{
	int x1, y1;
	int x2, y2;
	cin>>x1>>y1;
	cin>>x2>>y2;
	
	int resenje = 0;
	
	if(x1==x2 || y1==y2 || x1==(x2)*-1 || y1==(y2)*-1)
		resenje = 2;	
	
	if(x1-x2==y1-y2 || x1-x2== -1*(y1-y2))
		resenje = 1;
	
	cout<<resenje;
}