#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;

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

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

   

    if(x1 == x2 || y1 == y2){
        printf("2");
    }else if( (x1*x2) <= 0 || (y1*y2) <= 0 ){
        if(abs(x2-x1) == abs(y2-y1)){
            printf("1");
        } else {
            printf("0");
        }
    }else{
        if(x1 > x2){
            A = x1 - x2;
        } else {
            A = x2 - x1;
        }
        if(y1 > y2){
            B = y1 - y2;
        } else {
            B = y2 - y1;
        }

        if(A == B){
            printf("1");
        } else {
            printf("0");
        }
    }

    return 0;
}