from operator import itemgetter from itertools import * from bisect import * from collections import * from heapq import * from fractions import Fraction import sys sys.setrecursionlimit(10 ** 6) def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def SI(): return sys.stdin.readline()[:-1] def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] int1 = lambda x: int(x) - 1 def MI1(): return map(int1, sys.stdin.readline().split()) def LI1(): return list(map(int1, sys.stdin.readline().split())) p2D = lambda x: print(*x, sep="\n") dij = [(1, 0), (0, 1), (-1, 0), (0, -1)] inf=10**16 n,m,k=MI() aa=[II() for _ in range(n+1)] # dp[i]...i分後における最大所持金 dp=[0]*(n+2) dp[0]=k for _ in range(m): ndp=[0]*(n+2) for i in range(n+2): cur=ndp[i-1] if i else k mn=inf for j in range(i-2,-1,-1): mn=min(mn,aa[j]) c=dp[j]//mn r=dp[j]-c*mn cur=max(cur,aa[i-1]*c+r) ndp[i]=cur dp=ndp print(dp[-1])