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

s_rgb = sorted([r, g, b], reverse=True)

count = 0

for i in range(int(n / s_rgb[0]) + 1)[::-1]:

    for j in range(int((n - s_rgb[0] * i) / s_rgb[1]) + 1)[::-1]:

        tmp = n - s_rgb[0] * i - s_rgb[1] * j

        if (tmp >= 0 and tmp % s_rgb[2] == 0):

            count += 1

print(count)

R, G, B, N = [int(i) for i in input().split()]

dp = [0] * (N + 1)

dp[0] = 1

for c in (R, G, B):

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

        dp[i + c] += dp[i]

print((dp[N]))
r, g, b, n = list(map(int, input().split()))
s_rgb = sorted([r, g, b], reverse=True)
count = 0
for i in range(int(n / s_rgb[0]) + 1)[::-1]:
    for j in range(int((n - s_rgb[0] * i) / s_rgb[1]) + 1)[::-1]:
        tmp = n - s_rgb[0] * i - s_rgb[1] * j
        if tmp >= 0 and tmp % s_rgb[2] == 0:
            count += 1
print(count)

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

-r, g, b, n = list(map(int, input().split())) -s_rgb = sorted([r, g, b], reverse=True) -count = 0 -for i in range(int(n / s_rgb[0]) + 1)[::-1]: -    for j in range(int((n - s_rgb[0] * i) / s_rgb[1]) + 1)[::-1]: -        tmp = n - s_rgb[0] * i - s_rgb[1] * j -        if tmp >= 0 and tmp % s_rgb[2] == 0: -            count += 1 -print(count) +R, G, B, N = [int(i) for i in input().split()] +dp = [0] * (N + 1) +dp[0] = 1 +for c in (R, G, B): +    for i in range(N + 1 - c): +        dp[i + c] += dp[i] +print((dp[N]))