#include<bits/stdc++.h>
using namespace std;
int duzinaDuzi(int x1,int y1,int x2,int y2)
{
    return sqrt(abs(x1-x2)*abs(x1-x2)+abs(y1-y2)*abs(y1-y2));
}
int main()
{
    int x1,y1,x2,y2,x3,y3,x4,y4;
    cin>>x1>>y1>>x2>>y2;
    if(x1==x2 || y1==y2) cout<<"2";
    else
    {
        x3=x2;
        y3=y1;
        x4=x1;
        y4=y2;
        if(duzinaDuzi(x1,y1,x4,y4)==duzinaDuzi(x1,y1,x3,y3)) cout<<"1";
        else cout<<"0";

    }
    return 0;
}