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

int ans;
int x, y, xx, yy;

int main() {
  cin >> x >> y;
  cin >> xx >> yy;
  if (x == xx) ans = 2;
  else if (y == yy) ans = 2;
  else ans = 1;
  cout << ans << '\n';
  return 0;
}