N = int(input())
A = list(map(int, input().split())) + [0]
money = 1000
stock = 0
prev = 201

for i,price in enumerate(A):
    if price > prev:
        stock += money // prev
        money -= stock * prev

    elif price < prev and stock:
        money += prev * stock
        stock = 0
    prev = price

print(money)
