#include <bits/stdc++.h>

using namespace std;

int main() {
    long long x1, y1, x2, y2;
    scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);

    // Dijagonala
    if (abs(x2 - x1) == abs(y2 - y1)) {
        cout << 1;
    } else {
        cout << 2;
    }

    return 0;
}