r,g,b,N=list(map(int,input().split()))

c=0

for i in range(N//r+1):

    for j in range(N//g + 1):

        t = (N-i*r-j*g)

        if t%b ==0 and t>=0:

            #print(i,j,t//b)

            c+=1

print(c)
*s,n=list(map(int,input().split()))

s.sort()

c=0

for i in range(n//s[2]+1):

    for j in range(n//s[1]+1):

        if (n-s[2]*i-s[1]*j)%s[0] == 0 and 0<=(n-s[2]*i-s[1]*j):

            #print(i,j,n-s[2]*i-s[1]*j)

            c+=1

print(c)
r, g, b, N = list(map(int, input().split()))
c = 0
for i in range(N // r + 1):
    for j in range(N // g + 1):
        t = N - i * r - j * g
        if t % b == 0 and t >= 0:
            # print(i,j,t//b)
            c += 1
print(c)

*s, n = list(map(int, input().split()))
s.sort()
c = 0
for i in range(n // s[2] + 1):
    for j in range(n // s[1] + 1):
        if (n - s[2] * i - s[1] * j) % s[0] == 0 and 0 <= (n - s[2] * i - s[1] * j):
            # print(i,j,n-s[2]*i-s[1]*j)
            c += 1
print(c)

-r, g, b, N = list(map(int, input().split())) +*s, n = list(map(int, input().split())) +s.sort() -for i in range(N // r + 1): -    for j in range(N // g + 1): -        t = N - i * r - j * g -        if t % b == 0 and t >= 0: -            # print(i,j,t//b) +for i in range(n // s[2] + 1): +    for j in range(n // s[1] + 1): +        if (n - s[2] * i - s[1] * j) % s[0] == 0 and 0 <= (n - s[2] * i - s[1] * j): +            # print(i,j,n-s[2]*i-s[1]*j)