n = int(input())
A = list(map(int,input().split()))
money = 1000
stock = 0
for i in range(n-1):
    if A[i] >= A[i+1]:
        while stock:
            stock -= 1
            money += A[i]
    else:
        while money >= A[i]:
            money -= A[i]
            stock += 1

print(stock * A[n-1] + money)