#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long int x1,y1,x2,y2,res=0;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1==x2 || y1==y2) res = 2;
    else res = 1;
    cout << res;
    return 0;
}