ans=0

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

for i in range(n//r+2):

    for j in range(n//g+2):

        k=n-i*r-j*g

        if k>=0 and k%b==0:

            ans+=1



print(ans)
# coding: utf-8

#-------------------------------------------------------------------

import sys

def p(*a):

  s=" ".join(map(str,a))

  #print(s)

  sys.stderr.write(s+"\n")

#-------------------------------------------------------------------



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



if R<G: R,G=G,R

if G<B: G,B=B,G

if R<G: R,G=G,R



r=g=b=0

ans=0



#p(N//R+2)

#p(N//G+2)

#X=[]

#p(r,g,b)



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

	if (R*r)>N: break



	for g in range(N//G+2):

		if (R*r)+(G*g)>N:

			break

			X.append("break")

		

		b = (N-(R*r)-(G*g))//B

		n = (R*r)+(G*g)+(B*b)

		if n==N:

			ans+=1

#			X.append([r,g,b])

#		p(r,g,b,n,N,ans)



print(ans)

#p(X)

ans = 0
r, g, b, n = list(map(int, input().split()))
for i in range(n // r + 2):
    for j in range(n // g + 2):
        k = n - i * r - j * g
        if k >= 0 and k % b == 0:
            ans += 1
print(ans)

# coding: utf-8
# -------------------------------------------------------------------
import sys


def p(*a):
    s = " ".join(map(str, a))
    # print(s)
    sys.stderr.write(s + "\n")


# -------------------------------------------------------------------
R, G, B, N = list(map(int, input().split()))
if R < G:
    R, G = G, R
if G < B:
    G, B = B, G
if R < G:
    R, G = G, R
r = g = b = 0
ans = 0
# p(N//R+2)
# p(N//G+2)
# X=[]
# p(r,g,b)
for r in range(N // R + 2):
    if (R * r) > N:
        break
    for g in range(N // G + 2):
        if (R * r) + (G * g) > N:
            break
            X.append("break")
        b = (N - (R * r) - (G * g)) // B
        n = (R * r) + (G * g) + (B * b)
        if n == N:
            ans += 1
# 			X.append([r,g,b])
# 		p(r,g,b,n,N,ans)
print(ans)
# p(X)

+# coding: utf-8 +import sys + + +def p(*a): +    s = " ".join(map(str, a)) +    # print(s) +    sys.stderr.write(s + "\n") + + +R, G, B, N = list(map(int, input().split())) +if R < G: +    R, G = G, R +if G < B: +    G, B = B, G +if R < G: +    R, G = G, R +r = g = b = 0 -r, g, b, n = list(map(int, input().split())) -for i in range(n // r + 2): -    for j in range(n // g + 2): -        k = n - i * r - j * g -        if k >= 0 and k % b == 0: +# p(N//R+2) +# p(N//G+2) +# X=[] +# p(r,g,b) +for r in range(N // R + 2): +    if (R * r) > N: +        break +    for g in range(N // G + 2): +        if (R * r) + (G * g) > N: +            break +            X.append("break") +        b = (N - (R * r) - (G * g)) // B +        n = (R * r) + (G * g) + (B * b) +        if n == N: +# 			X.append([r,g,b]) +# 		p(r,g,b,n,N,ans) +# p(X)