n=int(input())
a = list(map(int,input().split()))

money=1000
sa=[]#差
stock=0

for num in range(len(a)-1):
  if a[num]<a[num+1]:
    sa.append("up")
  elif a[num]==a[num+1]:
    sa.append("same")
  elif a[num]>a[num+1]:
    sa.append("down")

what_to_do=[]#後ろから行動を決める

for num in range(len(sa)):
  if sa[num]=="up":
    try:
      if sa[num+1]!="up":
        what_to_do.append("sell")
      else:
        what_to_do.append("do nothing")

    except IndexError:
      what_to_do.append("sell")

  if sa[num]=="same":
    what_to_do.append("do nothing")

  if sa[num]=="down":
    try:
      if sa[num+1]!="down":
        what_to_do.append("buy")
      else:
        what_to_do.append("do nothing")

    except IndexError:
      what_to_do.append("do nothing")


first=[]
for command in what_to_do:
  if command=="buy":
    first.append("do nothing")
    break
  elif command=="sell":
    first.append("buy")
    break    
what_to_do=first+what_to_do    

cnt=0
for command in what_to_do:
  if command=="buy":
    stock=money//a[cnt]
    money=money%a[cnt]
    cnt+=1
  elif command=="sell":
    money+=stock*a[cnt]
    stock=0
    cnt+=1
  elif command=="do nothing":
    cnt+=1

print(money)