#include <stdio.h>
#include <stdlib.h>

int main()
{
    int x1, x2, y1, y2;

    scanf("%d %d", &x1, &y1);
    scanf("%d %d", &x2, &y2);

    if((abs(x1) == abs(x2)) || (abs(y1) == abs(y2)))
    {
        printf("2");
        return 0;
    }

    if(abs(x1 - y1) == abs(x2 - y2))
    {
        printf("1");
        return 0;
    }
    else
        printf("0");

    return 0;
}