import sys



N = int(sys.stdin.readline().strip())

A = list(map(int, sys.stdin.readline().split()))



money = 1000

min_price = float("inf")

for i in range(N):

    if min_price > A[i]:

        min_price = A[i]

    elif min_price < A[i]:

        num = money // min_price

        money = money - min_price * num + A[i] * num

        min_price = A[i]



print(money)
import sys



N = int(sys.stdin.readline())

A = list(map(int, sys.stdin.readline().split()))



yen = 1000

for i in range(1, N):

    if A[i-1] < A[i]:

        yen += (A[i] - A[i-1]) * (yen // A[i-1])



print(yen)
import sys

N = int(sys.stdin.readline().strip())
A = list(map(int, sys.stdin.readline().split()))
money = 1000
min_price = float("inf")
for i in range(N):
    if min_price > A[i]:
        min_price = A[i]
    elif min_price < A[i]:
        num = money // min_price
        money = money - min_price * num + A[i] * num
        min_price = A[i]
print(money)

import sys

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
yen = 1000
for i in range(1, N):
    if A[i - 1] < A[i]:
        yen += (A[i] - A[i - 1]) * (yen // A[i - 1])
print(yen)

-N = int(sys.stdin.readline().strip()) +N = int(sys.stdin.readline()) -money = 1000 -min_price = float("inf") -for i in range(N): -    if min_price > A[i]: -        min_price = A[i] -    elif min_price < A[i]: -        num = money // min_price -        money = money - min_price * num + A[i] * num -        min_price = A[i] -print(money) +yen = 1000 +for i in range(1, N): +    if A[i - 1] < A[i]: +        yen += (A[i] - A[i - 1]) * (yen // A[i - 1]) +print(yen)