#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(), a.end()
#define ff(i,a,b) for(int i=a;i<=b;i++)
#define fb(i,b,a) for(int i=b;i>=a;i--)

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 100005;
const int inf = 1e9 + 5;

ll x1, x2, y1, y2;

int main()
{
   ios::sync_with_stdio(false);
   cout.tie(nullptr);
   cin.tie(nullptr);
   cin >> x1 >> y1 >> x2 >> y2;
   if(x1 == x2 || y1 == y2)cout << 2 << endl;
   else cout << 1 << endl;
   return 0;
}
/**

1 1
3 3

56 34
105 34

**/