def main():

    red_box, green_box, blue_box, target = list(map(int, input().split()))

    answer = 0

    for i in range(target // red_box + 1):

        for j in range(target // green_box + 1):

            now_balls = red_box * i + green_box * j

            if (target - now_balls) % blue_box == 0 and target >= now_balls:

                answer += 1

            elif target < now_balls:

                break

    print(answer)





if __name__ == '__main__':

    main()



from math import ceil





def main():

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

    answer = 0

    for i in range(n + 1):

        for j in range(n + 1 - i * r):

            left = n - i * r - j * g

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

                answer += 1

    print(answer)





if __name__ == '__main__':

    main()



def main():
    red_box, green_box, blue_box, target = list(map(int, input().split()))
    answer = 0
    for i in range(target // red_box + 1):
        for j in range(target // green_box + 1):
            now_balls = red_box * i + green_box * j
            if (target - now_balls) % blue_box == 0 and target >= now_balls:
                answer += 1
            elif target < now_balls:
                break
    print(answer)


if __name__ == "__main__":
    main()

from math import ceil


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


if __name__ == "__main__":
    main()

+from math import ceil + + -    red_box, green_box, blue_box, target = list(map(int, input().split())) +    r, g, b, n = list(map(int, input().split())) -    for i in range(target // red_box + 1): -        for j in range(target // green_box + 1): -            now_balls = red_box * i + green_box * j -            if (target - now_balls) % blue_box == 0 and target >= now_balls: +    for i in range(n + 1): +        for j in range(n + 1 - i * r): +            left = n - i * r - j * g +            if left >= 0 and left % b == 0: -            elif target < now_balls: -                break