#include <stdio.h>
int aps(int a, int b){
    if((a-b)>0) return a-b;
    else return -1*(a-b);
}

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

    if(x2-x1==0 || y2-y1==0){printf("2");}
    else if(aps(x2,x1)==aps(y2,y1)){printf("1");}
    else {printf("0");}

    return 0;
}