#include <bits/stdc++.h>
static long long gcd(long long x, long long y) {
  return y == 0 ? x : gcd(y, x % y);
}
static long long pwm(long long x, long long n, long long m) {
  long long r = 1;
  while (n) {
    if (n & 1) r = r * x % m;
    x = x * x % m;
    n >>= 1;
  }
  return r;
}
int solve() {
  int n, m, x, y;
  scanf("%d%d%d%d", &n, &x, &m, &y);
  int l = abs(x - y);
  long long ans = n + m + 1;
  for (int i = 1; i <= n; ++i) {
    if (abs(l - i) < m) {
      ans += 2 * std::min(m, i + l - 1) + ((l - i) * 2 ^ -int(l >= i));
    }
  }
  printf("%lld\n", ans);
  return 0;
}
int main(int argc, char* argv[]) {
  ::std::ios::sync_with_stdio(false);
  ::std::cin.tie(0);
  ::std::cout.tie(0);
  int t = 1;
  while (t--) solve();
}
