#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) const ll INF = 1e9; int main(){ ll a,b,c,d; cin >> a >> b >> c >> d; c-= a; c = abs(c); d-=b; d = abs(d); int ans = 2; if (abs(c) + abs(d) <= 3) ans = 1; if (c == 0 || d == 0) ans = 1; cout << ans << endl; return 0; }