import math

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

cnt = 0

for i in range(math.ceil(N/G)+1):

	for j in range(math.ceil(N/R)+1):

			tmp = N - i * G - j * R

			if tmp < 0:

				break

			if tmp % B == 0:

				cnt += 1

print(cnt)
import math

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

cnt = 0

for i in range(math.ceil(N/G)+1):

	for j in range(math.ceil(N/R)+1):

			tmp = N - i * G - j * R

			if  tmp >=0 and tmp % B == 0:

				cnt += 1

print(cnt)
import math

R, G, B, N = list(map(int, input().split()))
cnt = 0
for i in range(math.ceil(N / G) + 1):
    for j in range(math.ceil(N / R) + 1):
        tmp = N - i * G - j * R
        if tmp < 0:
            break
        if tmp % B == 0:
            cnt += 1
print(cnt)

import math

R, G, B, N = list(map(int, input().split()))
cnt = 0
for i in range(math.ceil(N / G) + 1):
    for j in range(math.ceil(N / R) + 1):
        tmp = N - i * G - j * R
        if tmp >= 0 and tmp % B == 0:
            cnt += 1
print(cnt)

-        if tmp < 0: -            break -        if tmp % B == 0: +        if tmp >= 0 and tmp % B == 0: