Snuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:    * Red boxes, each containing R red balls   * Green boxes, each containing G green balls   * Blue boxes, each containing B blue balls  Snuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes. How many triples of non-negative integers (r,g,b) achieve this?

# coding: utf-8

# In[3]:

import sys
input = sys.stdin.readline
R, G, B, N = map(int, input().split())


# In[5]:

cnt = 0
a, b, c = sorted([R, G, B], reverse=True)
for i in range(N//a+1):
    for j in range((N-R*i)//b+1):
        if (N-a*i+b*j)%c == 0:
                cnt += 1
print(cnt)


# In[ ]:





# coding: utf-8

# In[3]:

import sys
input = sys.stdin.readline
R, G, B, N = map(int, input().split())


# In[14]:

cnt = 0
a, b, c = sorted([R, G, B], reverse=True)
#print(a, b, c)
#print(N//a)
for i in range(N//a+1):
    for j in range((N-a*i)//b+1):
        tmp = N-a*i-b*j
        if tmp%c == 0:
            #print('{}*{} + {}*{}'.format(a, i, b, j))
            cnt += 1
print(cnt)


# In[19]:

list(range(1//3 + 1))


# In[ ]:



