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