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

cnt=0

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

    for g in range(int((N-(r*R))/G+1)):

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

            cnt+=1

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

ans=0

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

    if r*i==n:

        ans+=1

        break

    else:

        for j in range((n-r*i)//g+1):

            if r*i+g*j==n:

                ans+=1

                continue

            else:

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

                    ans+=1



print(ans)
R, G, B, N = list(map(int, input().split()))
cnt = 0
for r in range(int(N / R + 1)):
    for g in range(int((N - (r * R)) / G + 1)):
        if (N - (r * R) - (g * G)) % B == 0:
            cnt += 1
print(cnt)

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

-R, G, B, N = list(map(int, input().split())) -cnt = 0 -for r in range(int(N / R + 1)): -    for g in range(int((N - (r * R)) / G + 1)): -        if (N - (r * R) - (g * G)) % B == 0: -            cnt += 1 -print(cnt) +r, g, b, n = list(map(int, input().split())) +ans = 0 +for i in range(n // r + 1): +    if r * i == n: +        ans += 1 +        break +    else: +        for j in range((n - r * i) // g + 1): +            if r * i + g * j == n: +                ans += 1 +                continue +            else: +                if n - (r * i + g * j) > 0 and (n - (r * i + g * j)) % b == 0: +                    ans += 1 +print(ans)