import sys

n, *aaa = map(int, sys.stdin.buffer.read().split())
dp = [-1] * 100001
dp[0] = 1000
for a in aaa:
    ndp = dp.copy()
    for stock in range(101):
        cash = dp[stock]
        if cash == -1:
            break
        for buy in range(1, cash // a + 1):
            ndp[stock + buy] = max(ndp[stock + buy], cash - a * buy)
        for sell in range(1, stock + 1):
            ndp[stock - sell] = max(ndp[stock - sell], cash + a * sell)
    dp = ndp
print(max(dp))
