#include <bits/stdc++.h>
int n, m, x, y;
long long ans;
void swap(int &x, int &y) {
  x ^= y;
  y ^= x;
  x ^= y;
}
int max(int a, int b) { return a > b ? a : b; }
int min(int a, int b) { return a < b ? a : b; }
int main() {
  int d, i;
  scanf("%d%d%d%d", &n, &x, &m, &y);
  if (x < y) {
    swap(x, y);
    swap(n, m);
  }
  if (x == y) {
    printf("%d\n", max(n, m) + 1);
    return 0;
  }
  d = x - y;
  ans = n + m + 1;
  for (i = 1; i <= n; i++) {
    if (i <= d)
      ans +=
          max(0, (i + min(m, d) - d) * 2 - 1) + min(max(0, m - d), i - 1) * 2;
    else
      ans += max(0, min(m - (i - d), d + i - 1 - (i - d))) * 2;
  }
  printf("%I64d\n", ans);
}
