#include<bits/stdc++.h>
using namespace std;
int X1, Y1, X2, Y2;
int main (){
    cin>>X1>>Y1>>X2>>Y2;
    if(X1!=X2 and Y1!=Y2){cout<<1<<endl;}
    else if(X1==0 and Y1==0 or (X2==0 and Y2==0)){cout<<2<<endl;}
    else{cout<<2<<endl;}
    return 0;
}