import sys



input = sys.stdin.readline





def main():

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



    ans = 0

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

        gGbB = N - r * R

        for g in range(gGbB // G + 1):

            bB = gGbB - g * G

            if bB % B == 0:

                ans += 1

    

    print(ans)





if __name__ == "__main__":

    main()

import sys



input = sys.stdin.readline





def main():

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



    dp = [0] * (N + 1)

    dp[0] = 1

    for c in [R, G, B]:

        for i in range(N - c + 1):

            dp[i + c] += dp[i]



    ans = dp[N]

    print(ans)





if __name__ == "__main__":

    main()

import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():
    R, G, B, N = list(map(int, input().split()))
    dp = [0] * (N + 1)
    dp[0] = 1
    for c in [R, G, B]:
        for i in range(N - c + 1):
            dp[i + c] += dp[i]
    ans = dp[N]
    print(ans)


if __name__ == "__main__":
    main()

-    ans = 0 -    for r in range(N // R + 1): -        gGbB = N - r * R -        for g in range(gGbB // G + 1): -            bB = gGbB - g * G -            if bB % B == 0: -                ans += 1 +    dp = [0] * (N + 1) +    dp[0] = 1 +    for c in [R, G, B]: +        for i in range(N - c + 1): +            dp[i + c] += dp[i] +    ans = dp[N]