#include <iostream>
#include <bits/stdc++.h>
using namespace std;

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