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

money = 1000
stock = 0

for i in range(N):
    if i == N - 1:
        money += stock * A[i]
        break
    if A[i] < A[i + 1]:
        stock += money // A[i]
        money -= A[i] * stock
    elif A[i] > A[i + 1]:
        money += A[i] * stock
        stock = 0

print(money)
