import math

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

ans = 0

r,g,b = 0,0,0

for i in range(math.floor(N/R)+1):

    for j in range(math.floor((N-i*R)/G)+1):

        if (N-R*i-G*j)%B == 0:

            ans += 1

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

ans = 0

for r in range(N+1):

    for g in range(N+1):

        b = N - r*R - g*G

        if 0 <= b and b%B == 0:

            ans += 1

print(ans)
import math

R, G, B, N = list(map(int, input().split()))
ans = 0
r, g, b = 0, 0, 0
for i in range(math.floor(N / R) + 1):
    for j in range(math.floor((N - i * R) / G) + 1):
        if (N - R * i - G * j) % B == 0:
            ans += 1
print(ans)

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

-import math - -r, g, b = 0, 0, 0 -for i in range(math.floor(N / R) + 1): -    for j in range(math.floor((N - i * R) / G) + 1): -        if (N - R * i - G * j) % B == 0: +for r in range(N + 1): +    for g in range(N + 1): +        b = N - r * R - g * G +        if 0 <= b and b % B == 0: