#include <stdio.h>

int main()
{
    int x1, x2, y1, y2;
    scanf("%d%d%d%d", &x1, &y1, &x2, &y2);
    if(abs(x2 - x1) == abs(y2 - y1))
    {
        printf("1");
    }
    else
    {
        printf("2");
    }
    return 0;
}