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

money = 1000
stock = 0
for i in range(n):
    if i == n-1 or a[i] > a[i + 1]:
        # 価格が下がる前、もしくは一番最後では売る
        money += stock * a[i]
        stock = 0
    elif a[i] < a[i+1]:
        # 価格が上がる前は買う
        stock = money // a[i]
        money -= stock * a[i]

print(money)