import sys from itertools import accumulate N, M, K = map(int, input().split()) stock_price = list(map(int, sys.stdin)) dp = [K]*len(stock_price) for _ in [0]*M: for t1, price1 in zip(range(N, -1, -1), stock_price[N::-1]): stock_count, rem = dp[t1] // price1, dp[t1] % price1 for t2, price2 in enumerate(stock_price[t1+1:], start=t1+1): if price1 < price2 and dp[t2] < stock_count * price2 + rem: dp[t2] = stock_count * price2 + rem dp = list(accumulate(dp, max)) print(max(dp))