N=int(input())
a_list=list(map(int,input().split()))

# 頂点を集める
now = a_list[0]
desc = True if a_list[0] > a_list[1] else False
i = 1
kabu = 0
money = 1000
if not desc:
  kabu = money // now
  money -= now * kabu
while i < len(a_list)-1:
  if desc:
    if now >= a_list[i+1]:
      now = a_list[i+1]
    else:
      # 次上がるなら株買う
      kabu = money // now
      money -= now * kabu
      desc = False
  else:
    if now <= a_list[i+1]:
      now = a_list[i+1]
    else:
      # 次下がるなら売る
      money += kabu * now
      kabu = 0
      desc = True
  now = a_list[i+1]
  i+=1

money += kabu * a_list[-1]
print(max(1000,money))

