N = int(input())
List = list(map(int,input().split()))
sell = []
buy = []
Listvar = List[:]
while Listvar:
  max_value = max(Listvar)
  max_index = Listvar.index(max_value)
  sell.append(max_index)
  if max_index == 0:
    break
  while Listvar[max_index] >= Listvar[max_index-1]:
      max_index -= 1
  buy.append(max_index)
  Listvar = Listvar[:max_index]

if len(buy) != len(sell):
  print(1000)
else:
  ans = 1000
  stock = 0
  for i in range(len(buy)):
    temp = ans
    ans = temp % List[buy[-(i+1)]]
    stock += temp // List[buy[-(i+1)]]
    ans += stock*List[sell[-(i+1)]]
    stock = 0
  print(ans)