#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, m;
  cin >> n >> x >> m >> y;
  long long sum = 1;
  if (x > y) {
    swap(n, m);
    swap(x, y);
  }
  if (x + n < y + m) sum += (long long)min(y + m - x - n, m);
  for (int i = n; i >= 1; i--) {
    int r1 = x + i - 1;
    int r2 = x - i + 1;
    if (r1 >= y) {
      r1 -= (r1 - y) * 2 + 1;
    }
    r1 = min(y + m, r1);
    r2 = max(r2, y - m);
    if (r1 >= r2) {
      sum += (long long)(r1 - r2) * 2 + 2;
    } else
      sum++;
  }
  cout << sum << endl;
}
