#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, X, M, Y;
  while (cin >> N >> X >> M >> Y) {
    long long d = abs(X - Y);
    if (d == 0LL) {
      cout << max(N, M) + 1LL << endl;
      continue;
    }
    if (d >= N + M) {
      cout << (N + M + 1) << endl;
      continue;
    }
    long long res = N + M + d + 1;
    if (N < d) res -= d - N;
    if (M < d) res -= d - M;
    for (long long r1 = (1); r1 <= (long long)(N - 1); ++r1) {
      long long lower = max(r1 - d + 1, 1LL), upper = min(r1 + d - 1, M - 1);
      lower = max(lower, d - r1);
      res += 2 * max(upper - lower + 1LL, 0LL);
    }
    cout << res << endl;
  }
}
