import sys
N, *A = map(int, open(0).read().split())

money = 1_000

stock = 0
L = []
for i in range(len(A)):
    a = A[i]
    if i+1 < len(A) and a == A[i+1]:
        continue
    if stock == 0:
        stock = 10
        L.append(a)
        continue
    if L[-1] < a:
        stock = 0
        L.append(a)

# print(L)

if len(L) == 1:
    print(money)
    sys.exit()

stock = 0
for l in L:
    if stock == 0:
        stock = money // l
        money -= stock * l
    else:
        money += stock * l
        stock = 0

print(money)