#include <bits/stdc++.h>   using namespace std;   const int MAXN = 0;   const int MOD = 1000000007;   template <class T>   inline void CLR(T &g) {     T t;     swap(t, g);   }   template <class T>   inline void CLR(T &g, int a) {     memset(g, a, sizeof g);   }   template <class T>   inline void CPY(T &a, T &b) {     memcpy(a, b, sizeof a);   }   template <class T>   inline bool inr(T a, T b, T c) {     return (a >= b && a <= c);   }   inline int acc(int a, int b) { return !!(a & (1 << b - 1)); }   inline int fil(int a, int b, int c) {     return a & ~(1 << b - 1) | (c ? (1 << b - 1) : 0);   }   int N, M, K, Q;   int a, b, c, l;   long long calc1(int p, int x1, int x2, int y1, int y2) {     int dx = x2 - x1 + 1, dy = y2 - y1 + 1;     if (dx <= dy) {       if (p - x1 < y1)         return 0;       else if (p - x2 < y1)         return (1ll * (p - x1 - y1 + 1 + 1) * (p - x1 - y1 + 1) / 2);       else if (p - x1 < y2)         return (1ll * (p - x1 - y1 + 1 + 1) * (p - x1 - y1 + 1) / 2) -                (1ll * (p - x2 - y1 + 1) * (p - x2 - y1) / 2);       else if (p - x2 <= y2)         return (1ll * (p - x1 - y1 + 1 + 1) * (p - x1 - y1 + 1) / 2) -                (1ll * (p - x2 - y1 + 1) * (p - x2 - y1) / 2) -                (1ll * (p - x1 - y2 + 1) * (p - x1 - y2) / 2);       else         return 1ll * (x2 - x1 + 1) * (y2 - y1 + 1);     } else       return calc1(p, y1, y2, x1, x2);   }   long long calc(int p, int x1, int x2, int y1, int y2) {     if (l + a + b + c - p <= p) return 0;     if (x1 > x2 || y1 > y2) return 0;     return -calc1(p, x1, x2, y1, y2) + calc1(l + a + b + c - p, x1, x2, y1, y2);   }   int main() {     int T, o = 0;     scanf( %d%d%d%d , &a, &b, &c, &l);     long long sum = 0;     for (register int(i) = a, _end_ = (a + l); (i) <= _end_; ++(i))       sum += calc(i, b, i, c, i);     for (register int(i) = b, _end_ = (b + l); (i) <= _end_; ++(i))       sum += calc(i, a, i - 1, c, i);     for (register int(i) = c, _end_ = (c + l); (i) <= _end_; ++(i))       sum += calc(i, a, i - 1, b, i - 1);     cout << sum << endl;     return 0;   }   