n = int(input())
a_list = list(map(int,input().split()))
row_price = float("inf")
high_price = -1
price = 1000
for i in range(n):
  if i == 0:
    row_price = a_list[i]
  if a_list[i] < row_price:
    row_price = a_list[i]
  elif a_list[i] > row_price:
      stock = price // row_price
      amari = price - row_price * stock
      price = a_list[i] * stock + amari
      row_price = float("inf")
      
print(price)
    