#include <bits/stdc++.h>
using namespace std;
long long gc(long long n, long long x, long long m, long long y) {
  if (x == y) return max(n, m) + 1;
  long long rc = (((x - y) > 0) ? (x - y) : -(x - y));
  long long res = m + n + 1;
  if (x > y) {
    swap(x, y);
    swap(m, n);
  }
  if (x + n <= y - m) return res;
  for (int i = (1); i < (m + 1); ++i)
    if (x + n > y - i) {
      long long c;
      if (y - i >= x)
        c = 2 * (min(n, y - x + i - 1) - (y - i - x)) - 1;
      else
        c = 2 * (min(n, y - x + i - 1) - min(n, i - (y - x)));
      res += c;
    }
  return res;
}
int main() {
  long long n, m, x, y;
  cin >> n >> x >> m >> y;
  cout << gc(n, x, m, y) << endl;
  return 0;
}
