import sys
from collections import defaultdict

n, *aaa = map(int, sys.stdin.buffer.read().split())
portfolio = {0: 1000}
for a in aaa:
    new_pf = defaultdict(int)
    for stock, cash in portfolio.items():
        if stock == 0:
            buy = cash // a
            new_pf[buy] = cash - a * buy
        new_pf[0] = max(new_pf[0], cash + a * stock)

    portfolio = new_pf
    
print(portfolio[0])
