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

cash = 1000
stocks = 0

buy = []
sell = []

trend = 'down'

for i in range(n-1):
    if trend == 'down':

        if A[i] >= A[i+1]:
            continue
        else:
            trend = 'up'
            buy.append(i)
            if i == n-2:
                sell.append(i+1)
    # 'up'
    else:
        if A[i] <= A[i+1]:
            continue
        else:
            trend = 'down'
            sell.append(i)

while len(buy) and len(sell):
    b = buy.pop(0)
    count = cash // A[b]
    cash -= A[b] * count
    stocks += count

    s = sell.pop(0)
    cash += A[s] * stocks
    stocks = 0

print(cash)
