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

money = 1000
stock = 0
price = float("INF")
for i in range(N-1):
    if A[i] < A[i+1]:
        stock += money // A[i]
        money -= A[i] * stock
        price = A[i]

    if price < A[i] and stock != 0:
        money += stock * A[i]
        stock = 0
        price = float("INF")

if price < A[N-1] and stock != 0:
    money += stock * A[N-1]
    stock = 0
    price = float("INF")
    
print(money)