
N = int(input())
A = list([int(x) for x in input().split()])

max_money = 1000
stock = 0

for i in range(N-1):
    if A[i] < A[i+1]:
        stock += money // A[i]
        money -= money - A[i] * stock
    else:
        money += stock * A[i]
        stock = 0


print(max_money)
