Last year the world's largest square was built in Berland. It is known that the square can be represented as an infinite plane with an introduced Cartesian system of coordinates. On that square two sets of concentric circles were painted. Let's call the set of concentric circles with radii 1, 2, ..., K and the center in the point (z, 0) a (K, z)-set. Thus, on the square were painted a (N, x)-set and a (M, y)-set. You have to find out how many parts those sets divided the square into.

Input

The first line contains integers N, x, M, y. (1 ≤ N, M ≤ 100000, - 100000 ≤ x, y ≤ 100000, x ≠ y).

Output

Print the sought number of parts.

Examples

Input

1 0 1 1


Output

4


Input

1 0 1 2


Output

3


Input

3 3 4 7


Output

17

Note

Picture for the third sample:

<image>
#include <bits/stdc++.h>
using namespace std;
namespace IO {
inline long long read() {
  long long s = 0, ww = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') ww = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    s = 10 * s + ch - '0';
    ch = getchar();
  }
  return s * ww;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar('0' + x % 10);
}
};  // namespace IO
using namespace IO;
inline void chkmin(long long &x, long long y) {
  if (y < x) x = y;
}
inline void chkmax(long long &x, long long y) {
  if (y > x) x = y;
}
inline long long abs(long long a, long long b) {
  long long ans = a - b;
  return ans >= 0 ? ans : -ans;
}
inline long long max(long long a, long long b) { return a > b ? a : b; }
inline long long min(long long a, long long b) { return a > b ? b : a; }
void solve() {
  long long n = read(), x = read(), m = read(), y = read();
  long long ans = n + 1;
  x = abs(x - y);
  if (n <= x) {
    if (x - n < m) {
      m -= x - n;
      ans += x - n;
      if (m < n)
        ans += m * (m + 1);
      else {
        m -= n;
        ans += n * (n + 1);
        if (m > n)
          ans += n * n + m - n;
        else
          ans += (2 * n - m) * m;
      }
    } else
      ans += m;
  } else {
    long long d = n - x;
    if (x >= d) {
      if (m <= d)
        ans += 2 * m * m;
      else {
        m -= d;
        ans += 2 * d * d;
        if (m <= x - d)
          ans += m * (1 + 4 * d + m);
        else {
          m -= x - d;
          ans += (x - d) * (1 + 3 * d + x);
          if (m < n)
            ans += (2 * n - m) * m;
          else {
            ans += n * n + m - n;
          }
        }
      }
    } else {
      if (m <= x)
        ans += 2 * m * m;
      else {
        m = m - x;
        ans += 2 * x * x;
        if (m < d - x)
          ans += (4 * x - 1) * m;
        else {
          ans += (4 * x - 1) * (d - x);
          m -= d - x;
          if (m < 2 * x)
            ans += m * (4 * x - m);
          else {
            ans += 4 * x * x + m - 2 * x;
          }
        }
      }
    }
  }
  write(ans);
  putchar('\n');
}
int main() {
  solve();
  return 0;
}
