import math
from itertools import groupby
N = int(input())
A = list(map(int, (input().split())))
cash = 1000
stock = 0
A = [i[0] for i in groupby(A)]
if (A[0] == max(A)):
    print(cash)
else:
    for i in range(len(A)-1):
        if (A[i] > A[i+1]):
            cash = cash + stock*A[i]
            stock = 0
        else:
            stock = stock + math.floor(cash/A[i])
            cash = cash - stock*A[i]
    cash = cash + stock*A[i+1]
    print(cash)