import sys
input = sys.stdin.readline
n = int(input())
arr = list(map(int, input().split()))
total = 1000
for i in range(n - 1):
    if arr[i] < arr[i + 1]:
        stocks = total // arr[i]
        total += (arr[i + 1] - arr[i]) * stocks
print(total)

492cfd89c9b05e49024eb2f86f63f9aa27442ed5
<mask token>

<mask token>
for i in range(n - 1):
    if arr[i] < arr[i + 1]:
        stocks = total // arr[i]
        total += (arr[i + 1] - arr[i]) * stocks
print(total)

<mask token>
input = sys.stdin.readline
n = int(input())
arr = list(map(int, input().split()))
total = 1000
for i in range(n - 1):
    if arr[i] < arr[i + 1]:
        stocks = total // arr[i]
        total += (arr[i + 1] - arr[i]) * stocks
print(total)

import sys
input = sys.stdin.readline
n = int(input())
arr = list(map(int, input().split()))
total = 1000
for i in range(n - 1):
    if arr[i] < arr[i + 1]:
        stocks = total // arr[i]
        total += (arr[i + 1] - arr[i]) * stocks
print(total)
