/*
ID: bajrakt1
TASK: ariprog
LANG: C++                 
*/
#include <bits/stdc++.h>
#include <stdlib.h> 
#include <time.h>  
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);cerr.tie(0);
#define PI 3.14159265358979323846
#define endl "\n"
//#define int long long
#define pb push_back
#define mp make_pair
//#define inf 1000000001
void solve(){
}
int32_t main(){
	IOS
	/*ofstream cout ("ariprog.out");
    ifstream cin ("ariprog.in");*/
    int x1,y1,x2,y2;
    cin  >> x1 >> y1 >> x2 >> y2; 
    if(x1!=x2 && y1!=y2){
		if(abs(x1-x2)==abs(y1-y2)){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}else {
		cout << 2 << endl;
	}
	return 0;
}