#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void chkmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline void chkmax(T &a, T b) {
  if (a < b) a = b;
}
int main() {
  int N, x, M, y, d, len1, len2, len, r1, r2, r, i;
  long long ans;
  scanf("%d%d%d%d", &N, &x, &M, &y);
  if (N < M) {
    swap(x, y);
    swap(N, M);
  }
  d = abs(x - y);
  ans = N + M + 1 - max(min(M, N - d), 0);
  for (i = 1; i <= N; i++) {
    if (i <= d)
      len1 = d - i + 1;
    else
      len1 = i - d;
    len2 = 1;
    r1 = d + i;
    r2 = M;
    len = max(len1, len2);
    r = min(r1, r2);
    ans += 2 * max(0, r - len + 1);
    if (len1 <= r2) ans--;
    if (r1 <= r2) ans -= 2;
  }
  printf("%I64d\n", ans);
  return 0;
}
