def solve():

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

    ans=0

    for i in range(N+1):

        for j in range(N+1):

            tmp=N-(R*i+G*j)

            if tmp>=0 and tmp%B==0:

                ans+=1

    print(ans)



solve()
def solve():

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

    ans=0

    for i in range(N+1):

        for j in range(N+1):

            tmp=N-R*i-G*j

            if tmp>=0 and tmp%B==0:

                ans+=1

    print(ans)



solve()
def solve():
    R, G, B, N = list(map(int, input().split()))
    ans = 0
    for i in range(N + 1):
        for j in range(N + 1):
            tmp = N - (R * i + G * j)
            if tmp >= 0 and tmp % B == 0:
                ans += 1
    print(ans)


solve()

def solve():
    R, G, B, N = list(map(int, input().split()))
    ans = 0
    for i in range(N + 1):
        for j in range(N + 1):
            tmp = N - R * i - G * j
            if tmp >= 0 and tmp % B == 0:
                ans += 1
    print(ans)


solve()

-            tmp = N - (R * i + G * j) +            tmp = N - R * i - G * j