#include <bits/stdc++.h>
using namespace std;
int x1, x2, z1, y2;
int main (){
        cin>>x1>>z1>>x2>>y2;
        if(x1==x2 or z1==y2){cout<<"2"<<endl;}
        else{if(x2-x1==y2-z1){cout<<"1"<<endl;}
             else{cout<<"0"<<endl;}
            }
return 0;
}