#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    long x1, y1, x2, y2, koliko_kvadrata;
    cin >> x1 >> y2 >> x2 >> y2;
    koliko_kvadrata = 0;
    if(x1 == x2 || y1 == y2) koliko_kvadrata = 2;
    koliko_kvadrata = ((x1 > x2) ? x1-x2 : x2-x1 == (y1 > y2) ? y1-y2 : y2-y1)?1:0;
    cout << koliko_kvadrata;
    return 0;
}