#include <bits/stdc++.h>
using namespace std;
long long X1, X2, Y1, Y2;

int main () {
cin >> X1 >> Y1 >> X2 >> Y2;

if (X1==X2 or Y1==Y2) {
    cout << 2 << endl;
    return 0;
}
if (abs(X1-X2)==abs(Y1-Y2)){
    cout << 1 << endl;
    return 0;
}
    cout << 0 << endl;
    return 0;


return 0;
}