#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  int x, y;
  long long r = 0;
  scanf("%d%d%d%d", &n, &x, &m, &y);
  r += n + m + 1;
  if (x > y) {
    swap(x, y);
    swap(m, n);
  }
  for (int i = 1; i <= n; i++) {
    if (x + i <= y - m || x + i >= y + m) continue;
    if (x + i > y) {
      int idis = i - (y - x);
      r += 2 * (min(m, 2 * i - 1 - idis) - idis);
    } else {
      int idis = y - x - i;
      r += 2 * min(m - idis, 2 * i - 1) - 1;
    }
  }
  cout << r << endl;
  return 0;
}
