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

money = 1000
num = 0

for i in range(N - 1):
    if A[i] < A[i + 1]:
        num += money // A[i]
        money -= (A[i] * num)
    if A[i] > A[i + 1]:
        money += (A[i] * num)
        num = 0
    if num != 0 and i + 2 == N:
        money += A[i + 1] * num

print(money)
