import  heapq
n=int(input())
aa=list(map(int,input().split()))
count=1
have=1000
l=[aa[0]]
ll=[-aa[0]]
heapq.heapify(l)
heapq.heapify(ll)
while count<n:
  mx=-heapq.heappop(ll)
  mn=heapq.heappop(l)
  if mx<=aa[count]:
    heapq.heappush(ll,-aa[count])
    heapq.heappush(l,aa[count])
    heapq.heappush(ll,-mn)
    heapq.heappush(l,mn)
    heapq.heappush(ll,-mx)
    heapq.heappush(l,mx)
    #print(l,ll)
  else:
    have+=(mx-mn)*int(have/mn)
    #print(mx,mn,l,ll)
    if count<=n-2:
      count+=1
      l=[aa[count]]
      ll=[-aa[count]]
      heapq.heapify(l)
      heapq.heapify(ll)
  count+=1
if len(l)!=0:
  mx=-heapq.heappop(ll)
  mn=heapq.heappop(l)
  have+=(mx-mn)*int(have/mn)
  
  
print(have)

    
    

  
    
  
