N = int(input())
prices = [int(n) for n in input().split()]
money = 1000
stock = 0
for n in range(N-1):
    p_today = prices[n]
    p_tomm = prices[n+1]
    if p_tomm >= p_today:
        while money >= p_today:
            stock += 1
            money -= p_today
    else:
        money += p_today * stock
        stock = 0

if stock > 0:
    money += prices[-1] * stock

print(money)