#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt,tune=native")
using namespace std;
int n, x, m, y;
int main() {
  cin >> n >> x >> m >> y;
  if (n > m) swap(n, m);
  if (x > y) swap(x, y);
  long long ans = 0;
  if (x + n <= y) {
    int tmp = -1;
    int i = y - x - n + 1;
    for (; i <= m && y - i >= x; ++i) {
      tmp += 2;
      ans += tmp;
    }
    for (; i <= m && y - i >= x - n; ++i) {
      ans += tmp;
      tmp -= 2;
    }
    ans += m + 1 + min(n, y - i - x + n + 1);
  } else {
    int tmp = -3;
    int i = 1;
    for (; i <= m && y + i <= x + n + 1 && y - i >= x; ++i) {
      tmp += 4;
      ans += tmp;
    }
    tmp += 2;
    for (; i <= m && y - i >= x; ++i) {
      ans += tmp;
      tmp += 2;
    }
    for (; i <= m && y + i <= x + n + 1; ++i) {
      ans += tmp;
    }
    for (; i <= m && y - i >= x - n; ++i) {
      tmp -= 2;
      ans += tmp;
    }
    ans += m + 1 + min(n, y - i - x + n + 1);
  }
  cout << ans << endl;
}
