n = int(input())
a = list(map(int,input().split()))

def check_increase(n,l):
    stock = []
    list_split = []
    for i in range(n-1):
        if l[i] < l[i+1]:
            stock.append(l[i])
            if i == n - 2:
                stock.append(l[i+1])
                list_split.append(stock)
        else:
            stock.append(l[i])
            list_split.append(stock)
            stock = []
            if i == n - 2:
                list_split.append([l[-1]])

    return list_split

a = sorted(set(a),key = a.index)
wallet = 1000
stock = 0
markets = check_increase(len(a),a)

for i in range(len(markets)):
    stock += wallet // markets[i][0]
    wallet %= markets[i][0]
    wallet += stock * markets[i][-1]
    stock = 0

print(wallet)