import math

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

count=0

k=[]

for i in range(n+1):

    for j in range(n+1):

        if n-(i*g+j*r)>=0:

            k.append(i*g+j*r)

        else:

            break

     

for i in range(len(k)):

    if (n-k[i])%b==0:

        count+=1

            

print(count)

            

    

    

            

                

    

        



     



    



     



    

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



x=n//r

y=n//g

ans=0

for i in range(x+1):

    for j in range(y+1):

        v=n-r*i-g*j

        if v<0:

            continue

        else:

            if v%b==0:

                ans+=1

print(ans)
import math

r, g, b, n = list(map(int, input().split()))
count = 0
k = []
for i in range(n + 1):
    for j in range(n + 1):
        if n - (i * g + j * r) >= 0:
            k.append(i * g + j * r)
        else:
            break
for i in range(len(k)):
    if (n - k[i]) % b == 0:
        count += 1
print(count)

r, g, b, n = list(map(int, input().split()))
x = n // r
y = n // g
ans = 0
for i in range(x + 1):
    for j in range(y + 1):
        v = n - r * i - g * j
        if v < 0:
            continue
        else:
            if v % b == 0:
                ans += 1
print(ans)

-import math - -count = 0 -k = [] -for i in range(n + 1): -    for j in range(n + 1): -        if n - (i * g + j * r) >= 0: -            k.append(i * g + j * r) +x = n // r +y = n // g +ans = 0 +for i in range(x + 1): +    for j in range(y + 1): +        v = n - r * i - g * j +        if v < 0: +            continue -            break -for i in range(len(k)): -    if (n - k[i]) % b == 0: -        count += 1 -print(count) +            if v % b == 0: +                ans += 1 +print(ans)