N = int(input())
A = list(map(int, input().split()))

max_index = [i for i, x in enumerate(A) if x == max(A)]
stopbuy = max_index[-1]

money = 1000
stock = 0

for i in range(stopbuy):
    if A[i+1] > A[i]:
        stock = money // A[i]
        money = money % A[i]
    else: # A[i+1] <= A[i]
        money = money + A[i] * stock
        stock = 0

money = money + A[stopbuy] * stock
print(money)
