#include<iostream>
#define JEDAN 1
#define NULA 0
#define DVA 2

using namespace std;

void FICA()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ios_base::sync_with_stdio(false);
    cout.tie(NULL);

    long long  x1,y1,x2,y2;

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

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

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