n = int(input())
a = list(input().split())
a = [int(s) for s in a]
a.append(0)
money = 1000
kabuka = 0
kabusu = 0
for i in range(n):
    #買う
    if a[i] < a[i+1]:
        kabusu = kabusu + money // a[i]
        if money // a[i] > 0: 
            money = money - a[i]*kabusu
            kabuka = a[i]
    #売る
    if a[i] > kabuka:
        money = money + a[i]*kabusu
        kabusu= 0
 
print(money)