import numpy as np
n = int(input())
values = np.array(list(map(int, input().split())))

money = 1000
kabu = 0
last_value = 10000
for i in range(n-1):
    #print(last_value, kabu, money)
    if last_value < values[i]:
        money += kabu * values[i]
        kabu = 0
        last_value = values[i]
        #print("sell", kabu, money)
        
    #print((last_value > values[i:]), (last_value < values[i:]))
    #if (values[i] < values[i:]).sum() > 0:
    if (last_value > values[i:]).argmax() < (last_value < values[i:]).argmax():
        if values[i] == last_value:
            continue
        kabu += money // values[i]
        money %= values[i]
        last_value = values[i]
        #print("buy", kabu, money)
        
    if last_value == 10000:
        if (values[i] < values[i:]).sum() > 0:
            if (values[i] < values[i:]).argmax() > (values[i] > values[i:]).argmax():
                kabu += money // values[i]
                money %= values[i]
                last_value = values[i]
                #print("buy", kabu, money)
                
if kabu > 0:
    money += kabu * values[-1]
    
print(money)