import numpy as np

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):
    max_value = max(a[i:])
    ind = a.index(max_value)
    if ind==i:
        min_value = max_value
    else:
        min_value = min(a[i:ind])

    if a[i]==min_value and a[i]<max_value:
        kau = money//a[i]
        kabu += kau
        money -= kau*a[i]
        #print('buy')
    else:
        money += kabu*a[i]
        kabu = 0
        #print('sell')

    #print('{0} {1}'.format(money, kabu))#横に並べて表示

print(money)
