#include<bits/stdc++.h>
using namespace std;
long long x1,x2,yjedan,y2,n,res;
int main(){
    cin>>x1>>yjedan>>x2>>y2;
    if(x1==x2 and (yjedan>y2 or y2>yjedan)){
        res=2;
        }
        else if(yjedan==y2 and (x1>x2 or x2>x1)){
        res=2;
        }
            else if((x1>x2 or x2>x1) and (yjedan>y2 or y2>yjedan)){
                res=1;
            }
                else
                    res=1;

                 cout<<res;

                 return 0;
}