#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++) #define reps(x, s) for(llint (x) = 0; (x) < (llint)(s).size(); (x)++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) #define ceildiv(x, y) (((x)+(y)-1) / (y)) #define all(x) (x).begin(),(x).end() #define outl(x) cout << x << endl #define SP << " " << #define inf 1e18 using namespace std; typedef long long llint; typedef long long ll; typedef pair P; bool exceed(ll x, ll y, ll m){return x >= m / y + 1;} ll a, b, c, d; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> a >> b >> c >> d; if(a == c || b == d || abs(a-c)+abs(b-d) <= 3) cout << 1 << endl; else cout << 2 << endl; return 0; }