N = int(input())
s_list = list(input().split())
money = 1000
stock = 0

for i in range(N):

  # Last day
  if (i == N-1):
    money += stock * int(s_list[i])
    stock = 0
    break

  # Stock price tomorrow is higher than today
  if (int(s_list[i+1]) > int(s_list[i])):
    stock = stock + int(money / int(s_list[i]))
    money = money - (int(s_list[i]) * int(money / int(s_list[i])))
    continue

  # Stock price tomorrow is lower than or equal to today
  if (int(s_list[i+1]) <= int(s_list[i])):
    money = money + (int(s_list[i]) * stock)
    stock = 0
    continue

print("money: {}".format(money))