n = int(input())
*A, = map(int, input().split())
n = 10
A = [200] * n
A = [200] + A + [0]
money = 1000
stock = 0
for i in range(1, n + 1):
    if (A[i - 1] > A[i]) and (A[i] <= A[i + 1]):
        cnt = money // A[i]
        money -= cnt * A[i]
        stock += cnt
    if (A[i - 1] <= A[i]) and (A[i] > A[i + 1]):
        money += stock * A[i]
        stock = 0
print(money)
