#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    int a, b;
    scanf("%d%d", &a, &b);
    a = abs(a - n);
    b = abs(b - m);
    a = max(a, b);
    printf("%d\n", a);
  }
  return 0;
}
