import sys



stdin = sys.stdin

 

ri = lambda: int(rs())

rl = lambda: list(map(int, stdin.readline().split()))

rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces



R, G, B, N = rl()

answer = 0

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

    sum = r * R

    for g in range((N-sum)//G + 1):

        sum2 = sum + g * G

        if (N-sum2)%B == 0:

            answer += 1



print(answer)

#45

import sys

import numpy as np



stdin = sys.stdin

 

ri = lambda: int(rs())

rl = lambda: list(map(int, stdin.readline().split()))

rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces



R, G, B, N = rl()

UP = 3000

A = np.zeros(UP+1, dtype=np.int32)



for r in range(UP+1):

    if r * R > UP:

        break

    A[r*R::G] += 1



answer = A[N::-B].sum()

print(answer)

#08

import sys

stdin = sys.stdin
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces
R, G, B, N = rl()
answer = 0
for r in range(N // R + 1):
    sum = r * R
    for g in range((N - sum) // G + 1):
        sum2 = sum + g * G
        if (N - sum2) % B == 0:
            answer += 1
print(answer)
# 45

import sys
import numpy as np

stdin = sys.stdin
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces
R, G, B, N = rl()
UP = 3000
A = np.zeros(UP + 1, dtype=np.int32)
for r in range(UP + 1):
    if r * R > UP:
        break
    A[r * R :: G] += 1
answer = A[N::-B].sum()
print(answer)
# 08

+import numpy as np -answer = 0 -for r in range(N // R + 1): -    sum = r * R -    for g in range((N - sum) // G + 1): -        sum2 = sum + g * G -        if (N - sum2) % B == 0: -            answer += 1 +UP = 3000 +A = np.zeros(UP + 1, dtype=np.int32) +for r in range(UP + 1): +    if r * R > UP: +        break +    A[r * R :: G] += 1 +answer = A[N::-B].sum() -# 45 +# 08