#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define vi vector<int>
#define vd vector<double>
using namespace std;
int main ()
{
    int x1,y1,x2,y2,maxx,maxy,absx1,absx2,absy1,absy2;
    cin>>x1>>y1>>x2>>y2;
    absx1 = abs(x1);
    absx2 = abs(x2);
    absy1 = abs(y1);
    absy2 = abs(y2);

    if (absx1>absx2)
    {
        x1+=absx1;
        x2+=absx1;
    }
    else
    {
        x1+=absx2;
        x2+=absx2;
    }
    if (absy1>absy2)
    {
        y1+=absy1;
        y2+=absy1;
    }
    else
    {
        y1+=absy2;
        y2+=absy2;
    }
    if (x1 == x2 || y1 == y2)
    {
        cout<<2;
        return 0;
    }
    else if (x1-x2 == y1-y2 || (x1==y2 && y1==x2))
    {
        cout<<1;
        return 0;
    }
    cout<<0;
    return 0;
}