n = int(input())
a = list(map(int, input().split()))
pair = []
l = -1
r = -1
flg = False
for i in range(n-1):
    if flg == False:
        if a[i+1]-a[i]>=0:
            l = i
            flg = True
        else:
            pass
    else:
        if a[i+1]-a[i]>=0:
            pass
        else:
            r = i
            flg = False
            pair.append((a[l],a[r]))
if flg:
    r = i+1
    pair.append((a[l],a[r]))
# print(pair)
money = 1000
stock = 0
max_rate = 0
for fr,to in pair: 
    if to/fr > max_rate:
        max_rate = to/fr
        #
        buy = money//fr
        stock += buy
        money -= buy*fr
        #
        sold = stock
        money += sold*to
        stock -= sold
    else:
        continue
print(money)

