#include<cstdio>
int a,b,c,n,ans;
int main() {
	scanf("%d%d%d%d",&a,&b,&c,&n);
	for(register int i=n/a;i>=0;i--)for(register int j=(n-i*a)/b;j>=0;j--)if(i*a+j*b+(n-i*a-j*b)/c*c==n)ans++;
	printf("%d",ans);
}