#include #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { int A, B, C, D; cin >> A >> B >> C >> D; if (A == C || B == D || abs(A - C) + abs(B - D) <= 3) cout << "1\n"; else cout << "2\n"; }