#include <bits/stdc++.h>
using namespace std;
int main(){
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    int r = r2 - r1, c = c2 - c1;
    int ans = 3;
    if(!r && !c) ans = 0;
    else if(r == c || r == -c || abs(r) + abs(c) <= 3) ans = 1;
    else if((r ^ c ^ 1) & 1 || abs(r + c) <= 3 || abs(r - c) <= 3 || abs(r) + abs(c) <= 6) ans = 2;
    cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int A[3];
  for (int i = 0; i < 3; i++) cin >> A[i];
  
  int p[3] = {0, 1, 2};
  bool res = false;
  do {
    if (A[p[2]] - A[p[1]] == A[p[1]] - A[p[0] ]) res = true;
  } while (next_permutation(p, p + 3));
  
  if (res) cout << "Yes";
  else cout << "No";
}