#include <bits/stdc++.h>
using namespace std;
int xa, xb, ya, yb;

void solve() {
int res = 0;
if (xa == xb || ya == yb ) {
    res = 2;
} else if (xa+ya == xb+yb || xa-ya == xb-yb) {
    res = 1;
}
cout << res << "\n";
}

int main() {
cin >> xa >> ya >> xb >> yb;
solve();
return 0;
}