Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())

cnt=0
for r in range(N+1):
    for g in range(N-r+1):
        b=N-(r+g)
        if b>=0 and r%R==g%G==b%B==0:
            cnt+=1
print(cnt)



Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())

RL=(N+R-1)//R
if RL*R>N:
    RL=RL-1

cnt=0
for r in range(RL+1):
    GL=(N-r*R+G-1)//G
    for g in range(GL+1):
        if (r*R+g*G)>N:continue
        if (N-r*R-g*G)%B==0:
            cnt+=1

print(cnt)

Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
R,G,B,N=map(int,input().split())

RL=(N+R-1)//R
if RL*F>N:
    RL=RL-1

cnt=0
for r in range(RL+1):
    GL=(N-r*R+G-1)//G
    for g in range(GL+1):
        if (r*R+g*G)>N:continue
        if (N-r*R-g*G)%B==0:
            cnt+=1

print(cnt)

Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())

RL=(N+R-1)//R

cnt=0
for r in range(RL+1):
    if r*R>N:continue
    GL=(N-r*R+G-1)//G
    for g in range(GL+1):
        if (r*R+g*G)>N:continue
        if (N-r*R-g*G)%B==0:
            cnt+=1

print(cnt)

Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if (N - (i * R + j * G)) % B == 0 and (N - (i * R + j * G)) >= 0:
            ans += 1
print(ans)


Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

ans = 0
for i in range(N // R + 1):
    for j in range((N - i * R) // G + 1):
        if (N - (i * R + j * G)) % B == 0 and (N - (i * R + j * G)) >= 0:
            ans += 1
print(ans)


Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

rmax = N // R + 1

ans = 0
for i in range(rmax):
    gmax = (N - i * R) // G + 1
    for j in range(gmax):
        if (N - (i * R + j * G)) % B == 0 and (N - (i * R + j * G)) >= 0:
            ans += 1  
print(ans)


Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int, input().split())

rmax = N // R + 1
gmax = N // G + 1

ans = 0
for i in range(rmax):
    for j in range(gmax):
        if (N - (i * R + j * G)) % B == 0 and (N - (i * R + j * G)) >= 0:
            ans += 1  # (N-(i*R+j*G))//B
print(ans)


Fixed submission:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(int(N / R) + 1):
    for j in range(int((N - i * R) / G) + 1):
        if ((N - (i * R + j * G)) % B == 0):
            ans += 1
print(ans)