N = int(input())
price = list(map(int,input().split()))
money = 1000
stack = 0

state = None
for i in range(1,N):
    if state == None:
        if price[i] < price[i-1]:
            money += price[i-1]*stack
            stack = 0
        elif price[i] > price[i-1]:
            stack = money//price[i-1]
            money = money%price[i-1]
    elif state == True and price[i] < price[i-1]:
        money += price[i-1]*stack
        stack = 0
    elif state == False and price[i] > price[i-1]:
        stack = money//price[i-1]
        money = money%price[i-1]

if stack != 0:
    money += price[-1]*stack
    stack = 0

print(money)
