from sys import stdin

input = stdin.readline



N = int(eval(input()))

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



start = 0

money = 1000



for i in range(N - 1):

    if A[i + 1] > A[i]:

        tmp = 10 ** 3

        for k in range(i, start - 1, -1):

            tmp = min(A[k], tmp)

        buy = money // tmp

        money -= tmp * buy

        money += buy * A[i + 1]

        start = i + 1



print(money)

from sys import stdin

input = stdin.readline



N = int(eval(input()))

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



start = 0

money = 1000



for i in range(N - 1):

    if A[i + 1] > A[i]:

        buy = money // A[i]

        money -= A[i] * buy

        money += buy * A[i + 1]



print(money)

from sys import stdin

input = stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
start = 0
money = 1000
for i in range(N - 1):
    if A[i + 1] > A[i]:
        tmp = 10**3
        for k in range(i, start - 1, -1):
            tmp = min(A[k], tmp)
        buy = money // tmp
        money -= tmp * buy
        money += buy * A[i + 1]
        start = i + 1
print(money)

from sys import stdin

input = stdin.readline
N = int(eval(input()))
A = list(map(int, input().split()))
start = 0
money = 1000
for i in range(N - 1):
    if A[i + 1] > A[i]:
        buy = money // A[i]
        money -= A[i] * buy
        money += buy * A[i + 1]
print(money)

-        tmp = 10**3 -        for k in range(i, start - 1, -1): -            tmp = min(A[k], tmp) -        buy = money // tmp -        money -= tmp * buy +        buy = money // A[i] +        money -= A[i] * buy -        start = i + 1