#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, q, w;
  cin >> n >> m >> q >> w;
  int ans1 = abs(q - n);
  int ans2 = abs(w - m);
  int ans3 = abs(ans1 - ans2) + min(ans1, ans2);
  cout << ans3 << endl;
  return 0;
}
