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

high = max(a)
low = min(a)

if a[0] == high:
    print(1000)
else:
    s = a.index(high)
    a = a[:s+1]
    wallet = 1000
    stock = 0
    markets = []
    market = [a[0]]
    for i in range(n-1):
        if a[i+1] == a[i]:
            continue
        if a[i+1] > a[i]:
            market.append(a[i+1])
            markets.append(market)
            market = [a[i+1]]
        else:
            market.append(a[i+1])

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