#include <bits/stdc++.h>
using namespace std;
ifstream fin("a.in");
long long comb(int n, int k) {
  if (n < k) return 0;
  if (k == 3) return 1ll * n * (n - 1) * (n - 2) / 6;
  if (k == 2) return 1ll * n * (n - 1) / 2;
}
int d;
long long f(int a, int b, int c) {
  long long s = 0;
  for (int la = 0; la <= d; la++) {
    int x = min(d - la, a + la - b - c);
    s += comb(x + 2, 2);
  }
  return s;
}
int main() {
  int a, b, c;
  long long s = 0;
  cin >> a >> b >> c >> d;
  s = comb(d + 3, 3);
  s -= f(a, b, c);
  s -= f(b, c, a);
  s -= f(c, a, b);
  cout << s << "\n";
}
