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

def solve():

    ans = 0

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

        b1 = N - i*R

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

            b2 = b1 - j*G

            if b2%B==0:

                ans += 1

    return ans

print((solve()))
def solve():

  ans = 0

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

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

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

      bb = N-r*R-g*G

      if bb>=0 and bb%B==0:

        ans += 1

  return ans

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


def solve():
    ans = 0
    for i in range(N // R + 1):
        b1 = N - i * R
        for j in range(b1 // G + 1):
            b2 = b1 - j * G
            if b2 % B == 0:
                ans += 1
    return ans


print((solve()))

def solve():
    ans = 0
    R, G, B, N = list(map(int, input().split()))
    for r in range(N // R + 1):
        for g in range(N // G + 1):
            bb = N - r * R - g * G
            if bb >= 0 and bb % B == 0:
                ans += 1
    return ans


print((solve()))

-R, G, B, N = list(map(int, input().split())) - - -    for i in range(N // R + 1): -        b1 = N - i * R -        for j in range(b1 // G + 1): -            b2 = b1 - j * G -            if b2 % B == 0: +    R, G, B, N = list(map(int, input().split())) +    for r in range(N // R + 1): +        for g in range(N // G + 1): +            bb = N - r * R - g * G +            if bb >= 0 and bb % B == 0: