#入力（後でいじる）

def pin(type=int):

    return list(map(type,input().split()))

#どっかで最悪計算量の入力データを用意する関数を作ろう？

"""

O(N^2)

"""

#solution:

#潜 影 蛇 手 ! !

*c,N=pin()



ans=0





I=(N//c[0])+1

J=N//c[1]+1

for i in range(I):

    for j in range(J):

        remain=(N-i*c[0]-j*c[1])

      

        if remain>=0 and remain%c[2]==0:

            

            ans+=1

            

print(ans)

#print(["NO","YES"][1-cond])

#print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])



#print#!/usr/bin/env python3

#%% for atcoder uniittest use

import sys

input= lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10**9)

def pin(type=int):return list(map(type,input().split()))

def tupin(t=int):return tuple(pin(t))

def lispin(t=int):return list(pin(t))

#%%code



def resolve():

    R,G,B,N=pin()

    cnt=0

    for r in range(N+1):

        for g in range(N+1):

            t=(R*r+G*g)

            if N<t:continue

            if (N-t)%B==0:

                #print(r,g,t)

                cnt+=1

    print(cnt)

#%%submit!    

resolve()

# 入力（後でいじる）
def pin(type=int):
    return list(map(type, input().split()))


# どっかで最悪計算量の入力データを用意する関数を作ろう？
"""
O(N^2)
"""
# solution:
# 潜 影 蛇 手 ! !
*c, N = pin()
ans = 0
I = (N // c[0]) + 1
J = N // c[1] + 1
for i in range(I):
    for j in range(J):
        remain = N - i * c[0] - j * c[1]
        if remain >= 0 and remain % c[2] == 0:
            ans += 1
print(ans)
# print(["NO","YES"][1-cond])
# print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])

# print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys

input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)


def pin(type=int):
    return list(map(type, input().split()))


def tupin(t=int):
    return tuple(pin(t))


def lispin(t=int):
    return list(pin(t))


#%%code
def resolve():
    R, G, B, N = pin()
    cnt = 0
    for r in range(N + 1):
        for g in range(N + 1):
            t = R * r + G * g
            if N < t:
                continue
            if (N - t) % B == 0:
                # print(r,g,t)
                cnt += 1
    print(cnt)


#%%submit!
resolve()

-# 入力（後でいじる） +# print#!/usr/bin/env python3 +#%% for atcoder uniittest use +import sys + +input = lambda: sys.stdin.readline().rstrip() +sys.setrecursionlimit(10**9) + + -# どっかで最悪計算量の入力データを用意する関数を作ろう？ -""" -O(N^2) -""" -# solution: -# 潜 影 蛇 手 ! ! -*c, N = pin() -ans = 0 -I = (N // c[0]) + 1 -J = N // c[1] + 1 -for i in range(I): -    for j in range(J): -        remain = N - i * c[0] - j * c[1] -        if remain >= 0 and remain % c[2] == 0: -            ans += 1 -print(ans) -# print(["NO","YES"][1-cond]) -# print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM]) +def tupin(t=int): +    return tuple(pin(t)) + + +def lispin(t=int): +    return list(pin(t)) + + +#%%code +def resolve(): +    R, G, B, N = pin() +    cnt = 0 +    for r in range(N + 1): +        for g in range(N + 1): +            t = R * r + G * g +            if N < t: +                continue +            if (N - t) % B == 0: +                # print(r,g,t) +                cnt += 1 +    print(cnt) + + +#%%submit! +resolve()