#include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //using namespace atcoder; using namespace std; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>>; vector seen; bool C = true; vector dist; ll mod =1e9+7; int op(int a, int b) { return min(a, b); } int e() { return int(1e9); } int main() { ll A, B, C, D; cin >> A >> B >> C >> D; if (A == C || B == D) { cout << 1 << endl; } else if (abs(A - C) + abs(B - D) <= 3) { cout << 1 << endl; } else cout << 2 << endl; }