R,G,B,N=list(map(int,input().split()))

counter=0

 

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

    for g in range((N-r*R)//G+1):

        b=(N-r*R-g*G)/B

        if b.is_integer() and b>=0:

            counter += 1

 

print(counter)
R,G,B,N=list(map(int,input().split()))

a=[0]*(N+1)

a[0]=1



for i in [R,G,B]:

    for j in range(N+1-i):

        a[j+i]+=a[j]

 

print((a[N]))

R, G, B, N = list(map(int, input().split()))
counter = 0
for r in range(N // R + 1):
    for g in range((N - r * R) // G + 1):
        b = (N - r * R - g * G) / B
        if b.is_integer() and b >= 0:
            counter += 1
print(counter)

R, G, B, N = list(map(int, input().split()))
a = [0] * (N + 1)
a[0] = 1
for i in [R, G, B]:
    for j in range(N + 1 - i):
        a[j + i] += a[j]
print((a[N]))

-counter = 0 -for r in range(N // R + 1): -    for g in range((N - r * R) // G + 1): -        b = (N - r * R - g * G) / B -        if b.is_integer() and b >= 0: -            counter += 1 -print(counter) +a = [0] * (N + 1) +a[0] = 1 +for i in [R, G, B]: +    for j in range(N + 1 - i): +        a[j + i] += a[j] +print((a[N]))