import sys input = sys.stdin.readline from operator import itemgetter N,M,K=map(int,input().split()) A=[int(input()) for i in range(N+1)] DP=[[] for i in range(M+1)] DP[0].append([0,K]) for a in A: NDP=[[] for i in range(M+1)] for i in range(M+1): for x,k in DP[i]: NDP[i].append([x,k]) for i in range(M+1): for x,k in DP[i]: plus=k//a NDP[i].append([x+plus,k-plus*a]) if i+1<=M: NDP[i+1].append([0,k+x*a]) DP=[[] for i in range(M+1)] for i in range(M+1): NDP[i].sort(key=itemgetter(1),reverse=True) NDP[i].sort(key=itemgetter(0)) for j in range(len(NDP[i])): if j>=1 and NDP[i][j][0]==NDP[i][j-1][0] and NDP[i][j][1]<=NDP[i][j-1][1]: continue x,k=NDP[i][j] DP[i].append([x,k]) ANS=0 for i in range(M+1): for x,y in DP[i]: ANS=max(ANS,y) print(ANS)