

r, g, b, n = [int(i) for i in input().split()]



ans = 0



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

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

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

            ans += 1



print(ans)
def trans(n, dp, color):

    for i in range(n-color+1):

        dp[i+color] += dp[i]

    return dp



def main():

    r, g, b, n = [int(i) for i in input().split()]

    dp = [0 for i in range(n+1)]

    dp[0] = 1

    dp = trans(n, dp, r)

    dp = trans(n, dp, g)

    dp = trans(n, dp, b)

    print((dp[-1]))



main()
r, g, b, n = [int(i) for i in input().split()]
ans = 0
for i in range(n // b + 1):
    for j in range((n - i * b) // g + 1):
        if (n - i * b - g * j) % r == 0:
            ans += 1
print(ans)

def trans(n, dp, color):
    for i in range(n - color + 1):
        dp[i + color] += dp[i]
    return dp


def main():
    r, g, b, n = [int(i) for i in input().split()]
    dp = [0 for i in range(n + 1)]
    dp[0] = 1
    dp = trans(n, dp, r)
    dp = trans(n, dp, g)
    dp = trans(n, dp, b)
    print((dp[-1]))


main()

-r, g, b, n = [int(i) for i in input().split()] -ans = 0 -for i in range(n // b + 1): -    for j in range((n - i * b) // g + 1): -        if (n - i * b - g * j) % r == 0: -            ans += 1 -print(ans) +def trans(n, dp, color): +    for i in range(n - color + 1): +        dp[i + color] += dp[i] +    return dp + + +def main(): +    r, g, b, n = [int(i) for i in input().split()] +    dp = [0 for i in range(n + 1)] +    dp[0] = 1 +    dp = trans(n, dp, r) +    dp = trans(n, dp, g) +    dp = trans(n, dp, b) +    print((dp[-1])) + + +main()