#include using namespace std; void solve() { int sx, sy, gx, gy; cin >> sx >> sy >> gx >> gy; auto dx = abs(gx - sx), dy = abs(gy - sy); if (dx == 0 && dy == 0) { cout << "0\n"; } else if (dx == 0 || dy == 0 || (dx <= 3 && dy <= 3 && dx + dy <= 3)) { cout << "1\n"; } else { cout << "2\n"; } } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); solve(); return 0; }