#include <bits/stdc++.h>
#define rep(i, l, r) for (int i = l; i < (int)(r); i++)
#define all(vec) vec.begin(), vec.end()
#define allr(vec) vec.rbegin(), vec.rend()
using namespace std;

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

using ll = long long;

using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vi = vector<int>;
using vll = vector<ll>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  ll r1, c1, r2, c2;
  cin >> r1 >> c1 >> r2 >> c2;

  int ans = 3;
  int a = abs(r2 - r1), b = abs(c2 - c1);
  if (a == 0 && b == 0) {
    ans = 0;
  } else if (a == b || a + b <= 3) {
    ans = 1;
  } else if ((a + b) % 2 == 0 || a + b <= 6 || abs(a - b) <= 3) {
    ans = 2;
  }

  cout << ans << endl;
  return 0;
}

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

int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << b - c << endl;;
}