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

res = 0

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

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

        if i*R + j*G > N: # はそもそもむり

            continue

        k = (N - R*i - G*j)

        if k % B != 0: # その倍数じゃないと無理

            continue

        res += 1

print(res)

#from statistics import median

#import collections

#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]

from fractions import gcd

from itertools import combinations,permutations # (string,3) 3回

#from collections import deque

from collections import deque,defaultdict

#import bisect

#

#    d = m - k[i] - k[j]

#    if kk[bisect.bisect_right(kk,d) - 1] == d:

#

#

#

# pythonで無理なときは、pypyでやると正解するかも！！

#

#



import sys

sys.setrecursionlimit(10000000)

mod = 10**9 + 7

#mod = 9982443453

def readInts():

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

def I():

  return int(eval(input()))



R,G,B,N = readInts()

cnt = 0

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

    for g in range(N//G+1):

        b = (N - r*R - g*G)//B

        #print(r,g,b)

        if b >= 0:

            if r*R + g*G + b*B == N:

                cnt += 1

print(cnt)

R, G, B, N = list(map(int, input().split()))
res = 0
for i in range(N // R + 1):
    for j in range(N // G + 1):
        if i * R + j * G > N:  # はそもそもむり
            continue
        k = N - R * i - G * j
        if k % B != 0:  # その倍数じゃないと無理
            continue
        res += 1
print(res)

# from statistics import median
# import collections
# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations, permutations  # (string,3) 3回

# from collections import deque
from collections import deque, defaultdict

# import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
import sys

sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
def readInts():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


R, G, B, N = readInts()
cnt = 0
for r in range(N // R + 1):
    for g in range(N // G + 1):
        b = (N - r * R - g * G) // B
        # print(r,g,b)
        if b >= 0:
            if r * R + g * G + b * B == N:
                cnt += 1
print(cnt)

-R, G, B, N = list(map(int, input().split())) -res = 0 -for i in range(N // R + 1): -    for j in range(N // G + 1): -        if i * R + j * G > N:  # はそもそもむり -            continue -        k = N - R * i - G * j -        if k % B != 0:  # その倍数じゃないと無理 -            continue -        res += 1 -print(res) +# from statistics import median +# import collections +# aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] +from fractions import gcd +from itertools import combinations, permutations  # (string,3) 3回 + +# from collections import deque +from collections import deque, defaultdict + +# import bisect +# +#    d = m - k[i] - k[j] +#    if kk[bisect.bisect_right(kk,d) - 1] == d: +# +# +# +# pythonで無理なときは、pypyでやると正解するかも！！ +# +# +import sys + +sys.setrecursionlimit(10000000) +mod = 10**9 + 7 +# mod = 9982443453 +def readInts(): +    return list(map(int, input().split())) + + +def I(): +    return int(eval(input())) + + +R, G, B, N = readInts() +cnt = 0 +for r in range(N // R + 1): +    for g in range(N // G + 1): +        b = (N - r * R - g * G) // B +        # print(r,g,b) +        if b >= 0: +            if r * R + g * G + b * B == N: +                cnt += 1 +print(cnt)