#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { long a, b, c, d; cin >> a >> b >> c >> d; if (a == c || b == d || abs(a - c) + abs(b - d) <= 3) { cout << 1 << endl; } else { cout << 2 << endl; } }