n=int(input())
list=[[0]*n]
list=input().split()
for i in range(n):
  list[i]=int(list[i])

yen=1000
stock=0
keikou=0
for i in range(1,n):
  if list[i]-list[i-1]<=0:
    keikou+=1
if keikou!=n-1:
  list2=sorted(list)
  list.index(list2[0])
  
  for t in range(1,n):
    if list[t]-list[t-1]>=0:
      while(yen>=list[t-1]):
        yen-=list[t-1]
        stock+=1
      yen+=list[t]*stock
      stock=0
print(yen)