#include <bits/stdc++.h>

using namespace std;

int x,x2;
int y,y2;


int main () {
    cin>>x>>y>>x2>>y2;
    if(x==x2 or y==y2){
        cout<<2<<endl;
    }
    else {
        if(x-y==x2-y2 or x+y==x2+y2){
            cout<<1<<endl;
        }
        else cout<<0<<endl;
    }
    return 0;
}