N = int(input())
*A, = map(int, input().split())
money, stock = 1000, 0
for a, nxt in zip(A, A[1:]):
    money += stock * a
    if a <= nxt:
        stock, money = divmod(money, a)
money += stock * A[-1]
print(money)