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

int main()
{
    int x1,y1,x2,y2;
    scanf("%d", &x1);
    scanf("%d", &y1);
    scanf("%d", &x2);
    scanf("%d", &y2);
    int k;
    if((x1!=x2)&(y1!=y2))
        k=1;
    else{
        k=2;
    }
    printf("%d", k);

}