#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
    long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a == c || b == d || abs(a - c) + abs(b - d) <= 3) {
        cout << 1 << endl;
    }
    else {
        cout << 2 << endl;
    }
}