N = int(input())
temp = [int(i) for i in input().split()]
A = list(dict.fromkeys(temp)) + [0]

ls = []
bottom = A[0]
for i in range(1, len(A)-1):
    if A[i-1] < A[i] and A[i] > A[i+1]:
        ls += [bottom, A[i]]
    if A[i-1] > A[i] and A[i] < A[i+1]:
        bottom = A[i]

stucks = 0
money = 1000
for i in range(len(ls)):
    if i % 2 == 0:
        stucks = money // ls[i]
        money -= stucks * ls[i]
    else:
        money += stucks * ls[i]
        stucks = 0

print(money)