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

          }



return 0;
}