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

# 頂点を集める
edge = [a_list[0]]
now = a_list[0]
desc = True if a_list[0] > a_list[1] else False
i = 1
while i < len(a_list)-1:
  if desc:
    if now >= a_list[i+1]:
      now = a_list[i+1]
    else:
      edge.append(now)
      desc = False
  else:
    if now <= a_list[i+1]:
      now = a_list[i+1]
    else:
      edge.append(now)
      desc = True
  now = a_list[i+1]
  i+=1

if edge[0] <= edge[-1]:
  desc = False
else:
  desc = True
kabu = 0
money = 1000
for e in edge:
  if desc:
    money += kabu * e
    kabu = 0
  else:
    kabu = money//e
    money -= kabu * e
  desc = not desc

money += kabu * a_list[-1]

print(max(1000,money))