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

A_l.append(0)

money = 1000
stock = 0

for i in range(N):

    if A_l[i] < A_l[i+1]:
        stock = money // A_l[i]
        money = money % A_l[i]
    if A_l[i] > A_l[i+1] and stock != 0:
        money = stock * A_l[i] + money
        stock = 0


print(money)