#include <iostream>

using namespace std;

int main()
{
    int xp, yp, xd, yd;
    cin >> xp >> yp >> xd >> yd;
    if(xp == xd || yp == yd)
        cout << "2" << endl;
    else if(xp - xd == yp - yd || xp - xd == (yp - yd) * (-1))
        cout << "1" << endl;
    else
        cout << "0" << endl;

    return 0;
}