#include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
template <typename first>
inline first abs(const first& a) {
  return a < 0 ? -a : a;
}
template <typename first>
inline first sqr(const first& a) {
  return a * a;
}
const long double PI = 3.1415926535897932384626433832795;
const long double EPS = 1e-9;
const int INF = 1000 * 1000 * 1000;
const int N = 2000 * 1000 + 13;
const int SH = 400 * 1000;
int n, x, m, y;
int cntlf[N], cntrg[N];
int main() {
  cin >> n >> x >> m >> y;
  if (x > y) {
    swap(n, m);
    swap(x, y);
  }
  x += SH, y += SH;
  if (x == y) {
    cout << max(n, m) + 1 << endl;
    return 0;
  }
  for (int i = 1; i <= int(m); i++) cntlf[y - i] = cntrg[y + i] = 1;
  for (int i = 1; i <= int(N - 1); i++)
    cntlf[i] += cntlf[i - 1], cntrg[i] += cntrg[i - 1];
  long long ans = n + m + 1;
  for (int i = 1; i <= int(n); i++) {
    int lf = x - i, rg = x + i;
    long long c1 = (cntlf[rg - 1] - cntlf[lf]);
    long long c2 = (cntrg[rg] - cntrg[lf]);
    if (c1 > 0) ans += c1 * 2 - 1;
    if (c2 > 0) ans -= c2 * 2 - 1;
  }
  cout << ans << endl;
  return 0;
}
