#include <bits/stdc++.h>
int main() {
  long int a, b, x, y, i, j, k, d, m, n;
  scanf("%ld %ld", &a, &b);
  scanf("%ld %ld", &x, &y);
  m = a - x;
  n = b - y;
  if (m < 0) m = -(m);
  if (n < 0) n = -(n);
  if (m > n)
    d = m;
  else
    d = n;
  printf("%ld\n", d);
  return 0;
}
