#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, res = 0;
  cin >> a >> b >> c >> d;
  if (d < b) swap(a, c), swap(b, d);
  for (long long int i = 1; i <= a; i++) {
    long long int low, high;
    if (d < b + i)
      low = (b + i) - d + 1;
    else
      low = d - (b + i) + 1;
    high = min(d - (b - i) - 1, c);
    res += 2 * max(0ll, high - low + 1);
    if (0 < high - low + 1 && b + i <= d) res--;
  }
  cout << res + a + c + 1 << endl;
}
