#include<iostream>
#include<cmath>
#define ll long long int
#define JEDAN 1
#define NULA 0
#define DVA 2

using namespace std;

void FICA()
{
    ll x1,y1,x2,y2;

    cin>>x1>>y1;
    cin>>x2>>y2;

    if(x1 == x2 || y1 == y2)
        cout<<DVA<<endl;
    //else if(abs(x1) == abs(y2) || abs(x2) == abs(y1))
        //cout<<JEDAN<<endl;
    else {
        if(abs(y2-y1) == abs(x1-x2))
            cout<<JEDAN<<endl;
        else cout<<NULA<<endl;
    }
}

int main(void)
{
    FICA();
    return 0;
}