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?
r,g,b,n = map(int,input().split())
count = 0
box = [r,g,b]
box.sort()
for i in range(n):
    for j in range(n):
        for k in range(n):
            if((box[0]*i + box[1]*j + box[2]*k) == n):
                count += 1
                break
            if(box[0]*k > n):
                break
        if(box[1]*j > n):
            break
    if(box[2]*i > n):
        break
print(count)
r, g, b, n = map(int, input().split())
ans = 0
for i in range(0, n+1, r):
    for j in range(0, n+1, g):
        if n < (i+j):
            break
        elif (n-(i+j))%b == 0:
            ans += 1

print(ans)