#include using namespace std; typedef long long LL; typedef vector V; typedef vector VV; typedef vector VVV; int main(){ int B,C,D,N;cin>>B>>C>>D>>N; vector v({B,C,D}); sort(v.begin(),v.end()); B=v[0],C=v[1],D=v[2]; VVV dp(101,VV(101,V(101,0))); dp[0][0][0]=1; for(int i=0;i>e; VVV nxt=dp; for(int b=0;b<=100;b++) for(int c=b;c<=100;c++) for(int d=c;d<=100;d++){ if(d<=e)nxt[c][d][e]+=dp[b][c][d]; else if(c<=e)nxt[c][e][d]+=dp[b][c][d]; else if(b<=e)nxt[e][c][d]+=dp[b][c][d]; else nxt[b][c][d]+=dp[b][c][d]; } swap(dp,nxt); } LL res=0; for(int b=B;b<=100;b++) for(int c=C;c<=100;c++) for(int d=D;d<=100;d++) res+=dp[b][c][d]; cout<