#include <bits/stdc++.h>
using namespace std;
long long int A[1000000];
long long int ind(long long int x) { return x + 500000; }
int main() {
  long long int i, j, k, l, m, n, x, y, z, a, b, r;
  scanf("%lld", &n);
  scanf("%lld", &x);
  scanf("%lld", &m);
  scanf("%lld", &y);
  if (x == y) {
    printf("%lld\n", 1 + max(n, m));
  } else {
    a = 0;
    for (i = 1; i <= n; i++) {
      A[ind(x - i)]++;
      A[ind(x + i)]--;
      if (!(y - m <= x - i && x + i <= y + m)) {
        a++;
      }
    }
    for (i = 1; i < 1000000; i++) A[i] += A[i - 1];
    for (i = 1; i <= m; i++) {
      k = A[ind(y + i) - 1] - A[ind(y - i)];
      if (abs(k) > 0)
        a += 2 * abs(k);
      else
        a++;
    }
    printf("%lld\n", a + 1);
  }
  return 0;
}
