N = int(input())
As = list(map(lambda x: int(x), input().split(" ")))

money = 1000
stock = 0
left_money = money

# 買って個数または残金が多くなるか売って残金が多くなるか
for a in As:
    if money < left_money + a * stock:
        money = left_money + a * stock
        left_money = money
        stock = 0
    elif stock < money // a:
        if stock == money // a:
            if left_money < money - stock * a:
                left_money = money - stock * a
        else:
            stock = money // a
            left_money = money - stock * a

print(money)
