n = int(input())
a_list = list(map(int,input().split()))
check_list = [0 for i in range(n)]
high_price = 0
row_price = a_list[0]
price = 1000
for i in range(1,n):
  if a_list[i] < a_list[i-1]:
    check_list[i] = "down"
  elif a_list[i] == a_list[i-1]:
    check_list[i] = "stay"
  else:
    check_list[i] = "up"  
hoge = "down" 
hoge_idx = 0
for i in range(1,n):
  if check_list[i] == hoge:
    check_list[hoge_idx] = "stay"
  else:
    hoge = check_list[i]
    hoge_idx = i
down_price = a_list[0]
for i in range(n):
  if check_list[i] == "down":
    down_price = a_list[i]
  if check_list[i] == "up":
    stock = price // down_price
    amari = price - stock * down_price
    price = stock * a_list[i] + amari

print(price)  
  
