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

cnt = 0

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

    M = N-R*i

    for j in range(M//G+1):

        L = M-G*j

        if L % B == 0:

            cnt += 1



print(cnt)
def main():

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

    c = 0

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

        m = n - r * i

        for j in range(m//g+1):

            l = m - g * j

            if l % b == 0:

                c += 1

            

    print(c)



main()
R, G, B, N = list(map(int, input().split()))
cnt = 0
for i in range(N // R + 1):
    M = N - R * i
    for j in range(M // G + 1):
        L = M - G * j
        if L % B == 0:
            cnt += 1
print(cnt)

def main():
    r, g, b, n = list(map(int, input().split()))
    c = 0
    for i in range(n // r + 1):
        m = n - r * i
        for j in range(m // g + 1):
            l = m - g * j
            if l % b == 0:
                c += 1
    print(c)


main()

-R, G, B, N = list(map(int, input().split())) -cnt = 0 -for i in range(N // R + 1): -    M = N - R * i -    for j in range(M // G + 1): -        L = M - G * j -        if L % B == 0: -            cnt += 1 -print(cnt) +def main(): +    r, g, b, n = list(map(int, input().split())) +    c = 0 +    for i in range(n // r + 1): +        m = n - r * i +        for j in range(m // g + 1): +            l = m - g * j +            if l % b == 0: +                c += 1 +    print(c) + + +main()