CodeEff/ECCO huggingface dataset:
# Original solution
def PrimeDecomp(N,ConcFlag):
    if ConcFlag:
        if N<=1:
            return [1],1
        else:
            I = 2
            PrimeDec = []
            DivCount = 1
            while I*I<=N:
                Cnt = 0
                while N%I==0:
                    N //= I
                    PrimeDec.append(I)
                if Cnt>=1:
                    DivCount *= (Cnt+1)
                I += 1
            if N>=2:
                PrimeDec.append(N)
                DivCount *= 2
            return PrimeDec,DivCount        
    else:
        if N<=1:
            return [1],[1],1
        else:
            I = 2
            PrimeDec = []
            PrimeCnt = []
            DivCount = 1
            while I*I<=N:
                Cnt = 0
                while N%I==0:
                    N //= I
                    Cnt += 1
                if Cnt>=1:
                    PrimeDec.append(I)
                    PrimeCnt.append(Cnt)
                    DivCount *= (Cnt+1)
                I += 1
            if N>=2:
                PrimeDec.append(N)
                PrimeCnt.append(1)
                DivCount *= 2
            return PrimeDec,PrimeCnt,DivCount
          
from itertools import combinations
from operator import mul
from functools import reduce
N = int(eval(input()))
PrimeDec,_ = PrimeDecomp(N,True)
FABMax = len(str(N))
for TR in range(1,len(PrimeDec)+1):
    for A in set(reduce(mul,T) for T in combinations(PrimeDec,TR)):
        B = N//A
        FABMax = min(FABMax,max(len(str(A)),len(str(B))))
print(FABMax)

# Optimized solution
def Divisor(N):
    Left,RightRev = [],[]
    I = 1
    while I*I<=N:
        if N%I==0:
            Left.append(I)
            if I!=N//I:
                RightRev.append(N//I)
        I += 1
    Div = Left+RightRev[::-1]
    DivCount = len(Div)
    return Div,DivCount
  
N = int(eval(input()))
Div,_ = Divisor(N)
FABMax = len(str(N))
for A in Div:
    B = N//A
    if A>B:
        break
    FABMax = min(FABMax,max(len(str(A)),len(str(B))))
print(FABMax)
# Original solution
n = int(eval(input()))
l = []

for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        f = max(len(str(a)), len(str(b)))
        l.append(f)

print((min(l)))

# Optimized solution
n = int(eval(input()))
l = []

for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        l.append(max(len(str(a)), len(str(b))))

print((min(l)))
# Original solution
import itertools
def f(a, b):
    return max(len(str(a)), len(str(b)))
def p(n):
    l = []
    a, b = 0, 2
    while b * b <= n:
        if n % b == 0:
            n //= b
            l += [b]
        else:
            b += 1 + a
            a = 1
    if n > 1 : l += [n]
    return l

N = int(eval(input()))
l = p(N)
if len(l) < 2:
    print((f(N, 1)))
else:
    w = len(l)
    ans = len(str(N))
    for i in itertools.product([0, 1], repeat=w):
        a = b = 1
        for j in range(w):
            if i[j] == 0:
                a *= l[j]
            else:
                b *= l[j]
        ans = min(ans, f(a, b))
    print(ans)

# Optimized solution
import itertools
def f(a, b):
    return max(len(str(a)), len(str(b)))
def p(n):
    l = []
    a, b = 0, 2
    while b * b <= n:
        if n % b == 0:
            n //= b
            l += [b]
        else:
            b += 1 + a
            a = 1
    if n > 1 : l += [n]
    return l

def main():
    N = int(eval(input()))
    l = p(N)
    if len(l) < 2:
        print((f(N, 1)))
    else:
        w = len(l)
        ans = len(str(N))
        for i in itertools.product([0, 1], repeat=w):
            a = b = 1
            for j in range(w):
                if i[j] == 0:
                    a *= l[j]
                else:
                    b *= l[j]
            ans = min(ans, f(a, b))
        print(ans)
if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
ans = n
for a in range(1, n + 1):
    if n % a == 0:
        b = n // a
        tmp = max(len(str(a)), len(str(b)))
        ans = min(ans, tmp)
        if a > b:
            break
print(ans)

# Optimized solution
n = int(eval(input()))
ans = n
for a in range(int(n ** (0.5)), 0, -1):
    if n % a == 0:
        b = n // a
        tmp = max(len(str(a)), len(str(b)))
        ans = min(ans, tmp)
print(ans)
# Original solution
from math import sqrt
from copy import deepcopy
from functools import reduce
from operator import mul
n = int(eval(input()))
def pf(n):
    pfs = []
    while n % 2 == 0:
        pfs.append(2)
        n //= 2
    for i in range(3, int(sqrt(n)+1), 2):
        while n % i == 0:
            pfs.append(i)
            n //= i
    if n > 2:
        pfs.append(n)
    return pfs
def partition(pfs):
    subsets = [[]]
    for i in range(len(pfs)):
        for j in range(len(subsets)):
            c = deepcopy(subsets[j])
            subsets.append(c + [i])
    return subsets

pfs = pf(n)
Asubs = partition(pfs)
def digits(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans

def calculate(Asubs):
    minSoFar = 10
    for Asub in Asubs:
        if Asub == []:
            Asum = 1
        else:
            Asum = reduce(mul, [pfs[i] for i in Asub])
        Bsub = [pfs[i] for i in range(len(pfs)) if i not in Asub]
        if Bsub == []:
            Bsum = 1
        else:
            Bsum = reduce(mul, Bsub)
        if max(digits(Asum), digits(Bsum)) < minSoFar:
            minSoFar = max(digits(Asum), digits(Bsum))
    return minSoFar
print((calculate(Asubs)))

# Optimized solution
from math import sqrt
n = int (eval(input()))
nsqrt = int(sqrt(n))
for i in range(nsqrt, 0, -1):
    if n % i == 0:
        b = n // i
        a = i
        break
    if i == 1:
        b = 1
        a = n
def digits(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans
print((max(digits(a), digits(b))))
# Original solution
from functools import reduce
n=int(eval(input()))
def sqdivlist(n):
    lista=[]
    for i in range(1,int((n**0.5)//1)+1):
        if n%i==0:
            lista.append(str(i))
    return (lista)
lista2=[]
ans=[]
for j in range(len(sqdivlist(n))):
    lista2.append(int(n/int((sqdivlist(n))[j])))
    ans.append(max(len(str(sqdivlist(n)[j])),(len(str(lista2[j])))))
print((min(ans)))


# Optimized solution
from functools import reduce
n=int(eval(input()))
def sqdivlist(n):
    lista=[]
    for i in range(1,int((n**0.5)//1)+1):
        if n%i==0:
            lista.append(str(i))
    return (lista)
t=len(sqdivlist(n))
u=(sqdivlist(n))
lista2=[]
ans=[]
for j in range(t):
    lista2.append(int(n/int(u[j])))
    ans.append(max(len(str(u[j])),(len(str(lista2[j])))))
print((min(ans)))
# Original solution
import math
n=int(eval(input()))
l=math.floor(math.sqrt(n))
k=math.floor(math.log10(n))+1
#print(k)
#print(math.log10(n))
for i in range(2,l+1):
    if n%i==0:
        a,b=i,n//i
        x=max(math.floor(math.log10(a))+1,math.floor(math.log10(b))+1)
        k=min(x,k)
print(k)


# Optimized solution
import math
n=int(eval(input()))
l=math.floor(math.sqrt(n))

for i in range(l+1,0,-1):
    if n%i==0:
        a,b=i,n//i
        k=max(math.floor(math.log10(a))+1,math.floor(math.log10(b))+1)
        break
print(k)
# Original solution
n = int(input())
s = input()

if n % 2 == 1:
    print('No')
    exit()

l = int(n/2)
print('Yes') if s[:l] == s[l:] else print('No')


# Optimized solution
n = int(input())
s = input()
print('Yes') if s[:n//2] == s[n//2:] else print('No')
# Original solution
N = int(eval(input()))
S = input().strip()
if N%2==1:
    flag = "No"
else:
    if S[:N//2]==S[N//2:]:
        flag = "Yes"
    else:
        flag = "No"
print(flag)

# Optimized solution
N = int(eval(input()))
S = input().strip()
if N%2==1:
    print("No")
else:
    if S[:N//2]==S[N//2:]:
        print("Yes")
    else:
        print("No")
# Original solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    s = str(readline().rstrip().decode('utf-8'))
    if n % 2 == 0:
        print(("Yes" if s[:n//2] == s[n//2:] else "No"))
    else:
        print("No")


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    s = str(input().rstrip('\n'))
    if n % 2 == 0:
        if s[:n // 2] == s[n//2:]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")


if __name__ == '__main__':
    solve()
# Original solution
r,g,b,n = list(map(int,input().split(' ')))
rmax, gmax = n//r, n//g
count = 0
i = 0
while i <= rmax:
    j = 0
    while j <= gmax:
        if (n-i*r-j*g) >= 0 and (n-i*r-j*g)%b == 0:
            count += 1
        j += 1
    i += 1
print(count)

# Optimized solution
r,g,b,n = list(map(int,input().split(' ')))
A = [r,g,b]
A.sort()
r,g,b = A[2], A[1], A[0]
rmax, gmax = n//r, n//g
count = 0
i = 0
while i <= rmax:
    j = 0
    if g == 1:
        count += (n-i*r)+1
        j += 30000
    while (n-i*r-j*g) >= 0:
        if (n-i*r-j*g)%b == 0:
            count += 1
        j += 1
    i += 1
print(count)
# Original solution
R, G, B, N = list(map(int, input().split()))

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

print(count)


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

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

print(count)
# Original solution
R, G, B, N = list(map(int, input().split()))

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

print(count)


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

tmp = [R, G, B]
tmp.sort()
R, G, B = tmp[2], tmp[1], tmp[0]


num_R = N // R + 1
num_G = N // G
RG = [[N - R*i for i in range(num_R)]]

for j in range(num_G):
    RG.append([RG[-1][i] - G for i in range(num_R)])

check = lambda x: 0 if x < 0 else 1 if x == 0 else 1 if x%B == 0 else 0

a = []
count = 0
for i in range(len(RG)):
    a = list(map(check, RG[i]))
    count += sum(a)

print(count)
# Original solution
r, g, b, n = list(map(int, input().split()))

cnt = 0
for i in range(3001):
    for j in range(3001):
        x = n - (r * i + g * j)
        if x < 0:
            continue
        if x % b == 0:
            cnt += 1

print(cnt)


# Optimized solution
r, g, b, n = list(map(int, input().split()))

cnt = 0
for i in range(int(n//r)+1):
    r_num = r * i
    for j in range(int((n - r_num)//g)+1):
        g_num = g * j
        b_num = (n - r_num - g_num)
        if b_num >= 0 and b_num % b == 0:
            cnt += 1

print(cnt)
# Original solution
r, g, b, n = list(map(int, input().split()))

cnt = 0
for i in range(int(n//r)+1):
    r_num = r * i
    for j in range(int((n - r_num)//g)+1):
        g_num = g * j
        b_num = (n - r_num - g_num)
        if b_num >= 0 and b_num % b == 0:
            cnt += 1

print(cnt)


# Optimized solution

def main():
    r, g, b, n = list(map(int, input().split()))

    cnt = 0
    for i in range(int(n//r)+1):
        r_num = r * i
        for j in range(int((n - r_num)//g)+1):
            g_num = g * j
            b_num = (n - r_num - g_num)
            if b_num >= 0 and b_num % b == 0:
                cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()
# Original solution
rn,gn,bn,n=list(map(int,input().split()))
nn=sorted([rn,gn,bn]) 
print((sum(n-nn[0]*r-nn[1]*g >=0 and (n-nn[0]*r-nn[1]*g)%nn[2]==0 for r in range(1+n//nn[0]) for g in range(1+n//nn[1]))))

# Optimized solution
rn,gn,bn,n=list(map(int,input().split()))
nn=sorted([rn,gn,bn]) 
c=0
for r in range(1+n//nn[0]):
    rt=n-nn[0]*r
    for g in range(1+rt//nn[1]):
        gt=rt-nn[1]*g
        if gt%nn[2]==0:
            c+=1
print(c)
# Original solution
R, G, B, N = list(map(int, input().split()))
ans = 0
for r in range(N // R + 1):
  for g in range(N // G + 1):
    d = N - R * r - G * g
    if d == 0 or (d > 0 and d % B == 0):
      ans += 1
print(ans)

# Optimized solution
R, G, B, N = list(map(int, input().split()))
ans = 0
for r in range(N // R + 1):
  d = N - R * r
  for g in range(d // G + 1):
    dd = d - G * g
    if dd == 0 or (dd > 0 and dd % B == 0):
      ans += 1
print(ans)
# Original solution
def ii():return int(eval(input()))
def iim():return list(map(int,input().split()))
def iil():return list(map(int,input().split()))
def ism():return list(map(str,input().split()))
def isl():return list(map(str,input().split()))

r,g,b,n = iim()
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        num = n-i*r-j*g
        if num%b == 0 and num//b >= 0:
#            print(i,j,num//b)
            ans += 1
print(ans)

# Optimized solution
def ii():return int(eval(input()))
def iim():return list(map(int,input().split()))
def iil():return list(map(int,input().split()))
def ism():return list(map(str,input().split()))
def isl():return list(map(str,input().split()))

#pythonだとTLE/pypyだとAC
'''
r,g,b,n = iim()
ans = 0
for i in range(n//r+1):
    for j in range(n//g+1):
        num = n-i*r-j*g
        if num%b == 0 and num//b >= 0:
#            print(i,j,num//b)
            ans += 1
print(ans)
'''

#上を受けてpythonでも通るように改良
*num,n = iim()
a,b,c = list(map(int,sorted(num)))
ans = 0
for i in range(n//c+1):
    if a!= 1:
        for j in range(n//b+1):
            num = n-i*c-j*b
            if num%a == 0 and num//a >= 0:
                ans += 1
    else:
        ret = n - i*c
        ans += ret//b+1
print(ans)
# Original solution
def main():
    red_box, green_box, blue_box, target = list(map(int, input().split()))
    answer = 0
    for i in range(target // red_box + 1):
        for j in range(target // green_box + 1):
            now_balls = red_box * i + green_box * j
            if (target - now_balls) % blue_box == 0 and target >= now_balls:
                answer += 1
    print(answer)


if __name__ == '__main__':
    main()



# Optimized solution
def main():
    red_box, green_box, blue_box, target = list(map(int, input().split()))
    answer = 0
    for i in range(target // red_box + 1):
        for j in range(target // green_box + 1):
            now_balls = red_box * i + green_box * j
            if (target - now_balls) % blue_box == 0 and target >= now_balls:
                answer += 1
            elif target < now_balls:
                break
    print(answer)


if __name__ == '__main__':
    main()
# Original solution
def main():
    red_box, green_box, blue_box, target = list(map(int, input().split()))
    answer = 0
    for i in range(target // red_box + 1):
        for j in range(target // green_box + 1):
            now_balls = red_box * i + green_box * j
            if (target - now_balls) % blue_box == 0 and target >= now_balls:
                answer += 1
            elif target < now_balls:
                break
    print(answer)


if __name__ == '__main__':
    main()



# Optimized solution
from math import ceil


def main():
    r, g, b, n = list(map(int, input().split()))
    answer = 0
    for i in range(n + 1):
        for j in range(n + 1 - i * r):
            left = n - i * r - j * g
            if left >= 0 and left % b == 0:
                answer += 1
    print(answer)


if __name__ == '__main__':
    main()
# Original solution
read = input
A = list(map(int, read().split()))
n = A[-1]
A = A[:3]
A.sort() # ascending
ans = 0
# print(A)
for i in range(n+1):
    for j in range(n+1):
        tmp = A[0]*i + A[1] * j
        if tmp > n:break
        tmp = n - tmp
        if tmp % A[2] == 0:
#             print(i, j, tmp//A[2])
            ans += 1
print(ans)

# Optimized solution
read = input
A = list(map(int, read().split()))
n = A[-1]
A = A[:3]
A.sort(reverse=True) # descending
ans = 0
if A[1] == A[2] and A[1] == 1: #deal with 1 1
    for i in range(n+1):
        tmp = i*A[0]
        if tmp > n:break
#         print(ans, i, A)
        ans += (n-tmp) - 0 + 1
else :
    for i in range(n+1):
        for j in range(n+1):
            tmp = i * A[0] + j * A[1]
            if tmp > n:break
            tmp = n - tmp
            if tmp % A[2] == 0:
    #             print(i, j, tmp//A[2])
                ans += 1
print(ans)
# Original solution
r, g, b, n = list(map(int, input().split()))

ans = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1):
        if n - r*i - g*j < 0:
            continue
        if (n - r*i - g*j)%b == 0:
            ans += 1
print(ans)


# Optimized solution
r, g, b, n = list(map(int, input().split()))

ans = 0
for i in range(n//r+1):
    for j in range((n-r*i)//g+1):
        if (n - r*i - g*j)%b == 0:
            ans += 1
print(ans)
# Original solution
#input
a = list(map(int,input().split())) #input from array of integer like "1 2 3"
n = a[3]
a = a[:3]
range_r = n//a[0]+1
range_g = n//a[1]+1
cnt = 0
for r in range(range_r):
  for g in range(range_g):
    rg = r*a[0]+g*a[1]
    if rg > n:
      break
    if (n - rg)%a[2]==0:
      cnt += 1

print(cnt)

# Optimized solution
#input
a = list(map(int,input().split())) #input from array of integer like "1 2 3"
n = a[3]
a = a[:3]
range_r = n//a[0]+1
range_g = n//a[1]+1
cnt = 0
for r in range(range_r):
  for g in range((n-r*a[0])//a[1]+1):
    rg = r*a[0]+g*a[1]
    if (n - rg)%a[2]==0:
      cnt += 1

print(cnt)
# Original solution
R,G,B,n=list(map(int,input().split()))
sum_rg=[]
for r in range(n+1):
	for g in range(n+1):
		Rr,Gg=R*r,G*g
		if Rr+Gg>n:
			break
		else:
			sum_rg.append(n-Rr-Gg)
count=0
for i in sum_rg:
	if not i%B:
		count+=1
print(count)

# Optimized solution
R,G,B,n=list(map(int,input().split()))
sum_rg=[0 for i in range(n+1)]
for r in range(n+1):
	for g in range(n+1):
		tmp=R*r+G*g
		if tmp>n:
			break
		else:
			#print(f'Bb:{n-tmp}')
			sum_rg[n-tmp]+=1
#print(sum_rg)
count=0
for i in range(n//B+1):
	count+=sum_rg[i*B]
print(count)
# Original solution
import math

line=input().split(" ")
n=int(line[3])
r=int(line[0])
g=int(line[1])
b=int(line[2])
nline=sorted([r,g,b])
x=int(nline[2])
y=int(nline[1])
z=int(nline[0])


answers=0
#print(x,y,z,n)


for i in range(math.ceil(n/x)+1):
    a=i
    for j in range(math.ceil(n/y)+1):
        b=j
        c=(n-a*x-b*y)/z
        if c>=0 and (n-a*x-b*y)%z==0:
            answers+=1
            #print(a,b,c)

print(answers)

# Optimized solution
# coding: utf-8
# Your code here!
import math

line=input().split(" ")
n=int(line[3])
r=int(line[0])
g=int(line[1])
b=int(line[2])
nline=sorted([r,g,b])
x=int(nline[2])
y=int(nline[1])
z=int(nline[0])

answers=0
#print(x,y,z,n)


for i in range(math.ceil(n/x)+1):
    a=i
    if z!=1:
        for j in range(math.ceil((n-a*x)/y)+1):
            b=j
            c=(n-a*x-b*y)/z
            if c>=0 and (n-a*x-b*y)%z==0:
                answers+=1
                #print(a,b,c)
    else:
        if n-a*x>=0:
            if n-a*x==0:
                answers+=1
                #print('a', 1)
            elif (n-a*x)%y!=0:
                answers+=math.ceil((n-a*x)/y)
                #print('b', math.ceil((n-a*x)/y))
            else:
                answers+=(math.ceil((n-a*x)/y)+1)
                #print('c', math.ceil((n-a*x)/y)+1)
            

print(answers)
# Original solution
R, G, B, N = list(map(int, input().split()))

count = 0
r_max = int(N / R)+1
g_max = int(N / G)+1

for r in range(r_max):
    rest_val = N - R*r
    for g in range(g_max):
        rest_val2 = rest_val - G * g
        if rest_val2 % B == 0 and rest_val2 >= 0:
            # print "r="+str(r)+",g="+str(g)+",b="+str(rest_val2/B)
            count += 1

print(count)

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

count = 0
r_max = int(N / R)+1
g_max = int(N / G)+1

for r in range(r_max):
    rest_val = N - R*r
    for g in range(g_max):
        rest_val2 = rest_val - G * g
        if rest_val2 < 0: break
        if rest_val2 % B == 0:
            # print "r="+str(r)+",g="+str(g)+",b="+str(rest_val2/B)
            count += 1

print(count)
# Original solution

r,g,b,n = list(map(int,input().split()))

ans = 0
rmax = n//r
gmax = n//g
for i in range(rmax+1):
    for j in range(gmax+1):
        rest = n-r*i-g*j
        flag = rest>=0 and rest%b==0
        if flag: ans += 1

print(ans)


# Optimized solution

r,g,b,n = list(map(int,input().split()))

ans = 0
rmax = n//r
for i in range(rmax+1):
    rest = n-r*i
    gmax = rest//g
    for j in range(gmax+1):
        rest = n-r*i-g*j
        if rest%b==0: ans += 1

print(ans)
# Original solution
R, G, B, n = list(map(int, input().split()))

cnt = []
for r in range(n//R + 1):
  nn = n - r*R
  for g in range(nn//G + 1):
    nnn = nn - g*G
    if nnn % B == 0:
      cnt.append([r, g, nnn // B])
print((len(cnt)))
    

# Optimized solution
a, b, c, n = list(map(int, input().split()))

cnt = 0
for i in range(n//a+1):
  an = n - a * i
  for j in range(an//b+1):
    num = an - b * j
    if num >= 0 and num % c == 0:
      cnt+=1
        
print(cnt)
# Original solution
a, b, c, n = list(map(int, input().split()))

cnt = 0
for i in range(n//a+1):
  an = n - a * i
  for j in range(an//b+1):
    num = an - b * j
    if num >= 0 and num % c == 0:
      cnt+=1
        
print(cnt)

# Optimized solution
a, b, c, n = list(map(int, input().split()))

cnt = 0
for i in range(n//a+1):
  an = n - a * i
  if an >= 0:
    for j in range(an//b+1):
      num = an - b * j
      if num >= 0 and num % c == 0:
        cnt+=1
        
print(cnt)
# Original solution
def main():
    R, G, B, N = list(map(int, input().split()))
    R, G, B = sorted([R, G, B])
    result = 0
    for i in range(N // G + 1):
        for j in range(N // B + 1):
            if (N - G*i - B*j) // R >= 0 and (N - G*i - B*j) % R == 0:
                result += 1
    print(result)
main()

# Optimized solution
def main():
    R, G, B, N = list(map(int, input().split()))
    R, G, B = sorted([R, G, B])
    result = 0
    for i in range(N // G + 1):
        for j in range(N // B + 1):
            if (N - G*i - B*j) < 0:
                break
            elif (N - G*i - B*j) % R == 0:
                result += 1
    print(result)
main()
# Original solution
# coding: utf-8
R, G, B, N = list(map(int, input().split()))

output = 0
for g in range(N // G + 1):
    for b in range(N // B + 1):
        if (N - g*G - b*B) % R == 0:
            if N >= g*G + b*B:
                output += 1
            else:
                break
print(output)


# Optimized solution
# coding: utf-8
R, G, B, N = list(map(int, input().split()))

output = 0
# for g in range(N // G + 1):
#     for b in range(N // B + 1):
#         if (N - g*G - b*B) % R == 0:
#             if N >= g*G + b*B:
#                 output += 1
#             else:
#                 break

for r in range(N // R + 1):
    C = N - r*R
    for g in range(C // G + 1):
        if (C - g*G) % B == 0:
            if C >= g*G:
                output += 1
            else:
                break

print(output)
# Original solution
import sys,random
try: sys.stdin = open('in.in','r')
except: pass

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

ans = 0
for r in range(0,N+1):
	if r*R > N: break
	for b in range(0,N+1):
		if b*B + r*R > N: break
		if (N-b*B-r*R)%G != 0: continue
		ans += 1
print(ans)


# Optimized solution
import sys,random
try: sys.stdin = open('in.in','r')
except: pass

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

ans = 0
for r in range(0,N+1,R):
	for b in range(0,N+1-r,B):
		if (N-b-r)%G != 0: continue
		ans += 1
print(ans)
# Original solution
R,G,B,N=(int(i) for i in input().split())
import math
answer=0
for r in range(0,math.floor(N/R)+1):
    for g in range(math.floor(N/G)+1):
        if R*r+G*g>N:
            break
        if (N-R*r-G*g)%B==0:
            answer+=1

print(answer)




# Optimized solution
R,G,B,N=(int(i) for i in input().split())
import math
answer=0
for r in range(0,math.floor(N/R)+1):
    for g in range(math.floor(N/G)+1):
        sss=R*r+G*g
        if sss>N:
            break
        if (N-sss)%B==0:
            answer+=1
print(answer)