#include #define NIL (-1) #define ll long long using namespace std; const double PI = acos(-1.0); 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; }