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

money = 1000
ticket = 0
for i in range(N):
    # buy
    if A[i] < A[i + 1]:
        money -= (money // A[i]) * A[i]
        ticket += money // A[i]
    elif A[i] == A[i + 1]:
        pass
    # sell
    else:
        money += A[i] * ticket
        ticket = 0
