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

max_money = 0

for i in range(2 ** n):
  money = 1000
  kabu = 0
  next_ = 'buy'
  for j in range(n):
    if 1&(i>>j):
      if next_ == 'buy':
        kabu = money // a[j]
        money = money % a[j]
        next_ = 'sale'
      else:
        money += kabu * a[j]
        kabu = 0
        next_ = 'buy'
  max_money = max(max_money,money)

print(max_money)