#include <iostream>

using namespace std;

int main()
{
    long long x, x1, y, y1;
    cin >> x >> x1 >> y >> y1;
    if(x == x1 || y == y1)
        cout << "1";
    else
        cout << "2";
    return 0;
}