n = int(input())
a = list(map(int, input().split())) # list()でリスト化、それを変数に代入。
money = 1000
kabu = 0
ind = 0
max_value = 0
min_value = 0
for i in range(n):
    if i == n-1:
        money += kabu*a[i]
        kabu = 0
    else:
        b = a[i:]
        max_value = max(b)
        ind = b.index(max_value)
        min_value = min(b[:ind+1])

        if a[i]==min_value and a[i]<max_value:
            kau = money//a[i]
            kabu += kau
            money -= kau*a[i]
        else:
            money += kabu*a[i]
            kabu = 0


print(money)
