#include <bits/stdc++.h>
using namespace std;
int n, m, x1, x2;
int main(void) {
  scanf("%d%d%d%d", &n, &x1, &m, &x2);
  int d = abs(x2 - x1);
  if (d >= (n + m)) {
    printf("%d\n", n + m + 1);
    return 0;
  }
  if (x1 > x2) {
    swap(x1, x2);
  }
  if (n > m) {
    swap(n, m);
  }
  long long ans = m + 1;
  for (int i = 1; i <= n; i++) {
    int l = -d - i;
    int r = -d + i;
    if (r <= -m) {
      ans++;
    } else {
      if (r <= 0) {
        int cnt = r - 1 - max(l + 1, -m) + 1;
        ans++;
        if (cnt > 0) ans++;
        if (cnt > 1) {
          ans += 2 * (cnt - 1);
        }
      } else {
        int cnt = abs(max(l + 1, -m)) - r;
        if (cnt > 0) ans += 2 * cnt;
        ans++;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}
