#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
    float x1,x2,y1,y2,absX,absY;

    cin >> x1 >> y1 >> x2 >> y2;

    absX = abs(abs(x1)-abs(x2));
    absY = abs(abs(y1)-abs(y2));

    if((y1 != y2) && (absX != absY))
    {
        cout << "0";
    }

    if((y1 != y2) && (absX == absY ))
    {
        cout << "1";
    }

    if((x1 == x2) || (y1 == y2))
    {
        cout << "2";
    }

    return 0;
}