#include <iostream>
#include <cmath>
using namespace std;

int main ()
{
	int x1,y1,x2,y2;
	int x,y;
	cin>>x1>>y1>>x2>>y2;
	x=(0-x1)-(0-x2);
	x=abs(x);
	y=(0-y1)-(0-y2);
	y=abs(y);
	if(x==0 || y==0)
    {
        cout<<2<<endl;
    }
    else if(x==y)
    {
        cout<<1<<endl;
    }
    else cout<<0<<endl;
	return 0;
}