#include<iostream>
#include<cmath>

using namespace std;

int x1,y5,x2,y2;

int main()
{
    cin>>x1>>y5>>x2>>y2;
    if(x1==x2)
        cout<<2<<endl;
    else if(y5==y2)
        cout<<2<<endl;
    else if(abs(x2-x1)==abs(y2-y5))
        cout<<1<<endl;
    else
        cout<<0<<endl;

    return 0;
}