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

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

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

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

    return 0;
}