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



cnt = 0

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

    r_num = r * i

    for j in range(int((n - r_num)//g)+1):

        g_num = g * j

        b_num = (n - r_num - g_num)

        if b_num >= 0 and b_num % b == 0:

            cnt += 1



print(cnt)



def main():

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



    cnt = 0

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

        r_num = r * i

        for j in range(int((n - r_num)//g)+1):

            g_num = g * j

            b_num = (n - r_num - g_num)

            if b_num >= 0 and b_num % b == 0:

                cnt += 1



    print(cnt)





if __name__ == "__main__":

    main()
r, g, b, n = list(map(int, input().split()))
cnt = 0
for i in range(int(n // r) + 1):
    r_num = r * i
    for j in range(int((n - r_num) // g) + 1):
        g_num = g * j
        b_num = n - r_num - g_num
        if b_num >= 0 and b_num % b == 0:
            cnt += 1
print(cnt)

def main():
    r, g, b, n = list(map(int, input().split()))
    cnt = 0
    for i in range(int(n // r) + 1):
        r_num = r * i
        for j in range(int((n - r_num) // g) + 1):
            g_num = g * j
            b_num = n - r_num - g_num
            if b_num >= 0 and b_num % b == 0:
                cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

-r, g, b, n = list(map(int, input().split())) -cnt = 0 -for i in range(int(n // r) + 1): -    r_num = r * i -    for j in range(int((n - r_num) // g) + 1): -        g_num = g * j -        b_num = n - r_num - g_num -        if b_num >= 0 and b_num % b == 0: -            cnt += 1 -print(cnt) +def main(): +    r, g, b, n = list(map(int, input().split())) +    cnt = 0 +    for i in range(int(n // r) + 1): +        r_num = r * i +        for j in range(int((n - r_num) // g) + 1): +            g_num = g * j +            b_num = n - r_num - g_num +            if b_num >= 0 and b_num % b == 0: +                cnt += 1 +    print(cnt) + + +if __name__ == "__main__": +    main()