#include <bits/stdc++.h>
using namespace std;
int n, x, m, y;
int main() {
  int i, j, k, flag;
  long long ans;
  int l1, l2, r1, r2, l, r;
  int cnt;
  while (scanf("%d%d%d%d", &n, &x, &m, &y) != EOF) {
    if (x > y) {
      k = x;
      x = y;
      y = k;
    }
    ans = 1;
    flag = 0;
    for (i = 1; i <= n; i++) {
      k = ans;
      if (i + x == y) {
        r1 = y - x + i;
        r = min(r1, m);
        cnt = 0;
        if (r1 <= r) {
          cnt++;
        }
        ans += 2 * (r - cnt) + cnt;
        flag = 1;
      } else if (i + x > y) {
        l1 = i + x - y;
        r1 = y - x + i;
        if (m < l1) {
          ans++;
          continue;
        }
        r = min(r1, m);
        cnt = 1;
        if (r1 <= r) {
          cnt++;
        }
        ans += (r - l1 + 1 - cnt) * 2 + cnt;
        flag = 1;
      } else {
        l1 = y - x - i;
        r1 = y - x + i;
        if (m < l1) {
          ans++;
          continue;
        }
        cnt = 1;
        r = min(r1, m);
        if (r1 <= r) {
          cnt++;
        }
        ans += 2 * (r - l1 + 1 - cnt) + cnt;
        flag = 1;
      }
    }
    for (i = 1; i <= m; i++) {
      if (i + x == y) {
        continue;
      } else if (i + x > y) {
        l1 = i + x - y;
        r1 = y - x + i;
        if (n < l1) {
          ans++;
        }
      } else {
        l1 = y - x - i;
        r1 = y - x + i;
        if (n < l1) {
          ans++;
          continue;
        }
      }
    }
    if (flag) ans++;
    cout << ans << endl;
  }
  return 0;
}
