#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x1, x2;
  cin >> n >> x1 >> m >> x2;
  int d = abs(x1 - x2);
  if (d >= n + m) {
    cout << n + m + 1 << endl;
    return 0;
  }
  if (n > m) swap(n, m);
  long long ans = m + 1;
  for (int i = 1; i <= n; ++i) {
    int l = -d - i, 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;
        ++ans;
        if (cnt > 0) ans += 2 * cnt;
      }
    }
  }
  cout << ans << endl;
}
