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

import math

answer=0

for r in range(0,math.floor(N/R)+1):

    for g in range(math.floor(N/G)+1):

        sss=R*r+G*g

        if sss>N:

            break

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

            answer+=1

print(answer)

 



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

import math

answer=0

for r in range(0,math.floor(N/R)+1):

    for g in range(math.floor(N/G)+1):

        if R*r+G*g>N:

            break

        if (N-R*r-G*g)%B==0:

            answer+=1



print(answer)





R, G, B, N = (int(i) for i in input().split())
import math

answer = 0
for r in range(0, math.floor(N / R) + 1):
    for g in range(math.floor(N / G) + 1):
        sss = R * r + G * g
        if sss > N:
            break
        if (N - sss) % B == 0:
            answer += 1
print(answer)

R, G, B, N = (int(i) for i in input().split())
import math

answer = 0
for r in range(0, math.floor(N / R) + 1):
    for g in range(math.floor(N / G) + 1):
        if R * r + G * g > N:
            break
        if (N - R * r - G * g) % B == 0:
            answer += 1
print(answer)

-        sss = R * r + G * g -        if sss > N: +        if R * r + G * g > N: -        if (N - sss) % B == 0: +        if (N - R * r - G * g) % B == 0: