#include <bits/stdc++.h>
#define K int(2e5 + 5)
#define INF ll(1e17)
#define MOD (long long)(1e9 + 7)
#define endl "\n"
using namespace std;
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;

void solve(){
    int x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int s1 = abs(x1 - x2), s2 = abs(y1 - y2);
    if (s1 == 0 || s2 == 0) {
        cout << 2 << endl;
        return;
    }
    cout << (s1 == s2) << endl;
}
 
int main(){
    //freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
 
    return 0;
}