#include using namespace std; struct iofast_t { iofast_t() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); } } iofast; struct uns_t {} uns; template auto vec(Element init, Head arg, Args ...args) { if constexpr (sizeof...(Args) == 0) return std::vector(arg, init); else return std::vector(arg, vec(init, args...)); } template auto vec(uns_t, Head arg, Args ...args) { return vec(Element(), arg, args...); } int main() { int64_t a, b, c, d; cin >> a >> b >> c >> d; c -= a; d -= b; if (abs(c) + abs(d) <= 3 || (c == 0 || d == 0)) { cout << 1 << endl; } else { cout << 2 << endl; } }