n = int(input())
prices = list(map(int,input().split()))
stock_num = 0
cash = 1000

for i in range(n-1):
    if prices[i+1] >= prices[i]:
        while cash >= prices[i]:
            cash -= prices[i]
            stock_num += 1
    else:
        while stock_num != 0:
            cash += prices[i]
            stock_num -=1

while stock_num != 0:
    cash += prices[n-1]
    stock_num -=1

print(cash)
