#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y;
inline long long swap(long long &a, long long &b) {
  a = a ^ b;
  b = a ^ b;
  a = a ^ b;
}
void solve() {
  if (x > y) {
    swap(n, m);
    swap(x, y);
  }
  y -= x;
  x = 0;
  long long ans = 1 + m;
  for (long long i = 1; i <= n; i++) {
    if (i <= y - m || i >= y + m) {
      ans++;
      continue;
    }
    long long d = y - i;
    if (d < 0) {
      d = i - y;
      long long more = m - d;
      if (-i < y - m) {
        ans += 2 * more + 1;
      } else {
        ans += 4 * y - 1;
      }
    } else {
      long long more = m - d;
      if (-i < y - m) {
        ans += 2 * more;
      } else {
        ans += 4 * i - 2;
      }
    }
  }
  printf("%I64d\n", ans);
}
int main() {
  while (~scanf("%I64d %I64d %I64d %I64d", &n, &x, &m, &y)) {
    solve();
  }
}
