N = int(input())
A = list(map(int, input().split()))
strategy = ["stay"] * len(A)

trend = "down"
for i in range(len(A)):
    if i == len(A) - 1:
        new_trend = "down"
        strategy[i] = "sell"
    else:
        if A[i] < A[i+1]:
            new_trend = "up"
            if trend != new_trend:
                strategy[i] = "buy"
        elif A[i] > A[i+1]:
            new_trend = "down"
            if trend != new_trend:
                strategy[i] = "sell"
        else:
            strategy[i] = "stay"
    trend = new_trend


money = 1000
stock = 0
for s in range(len(strategy)):
    if strategy[s] == "sell":
        money = money + stock * A[s]
        stock = 0
    elif strategy[s] == "buy":
        stock = money // A[s]
        money = money - A[s] * stock
    else:
        continue
print(money)