N=int(input())
A=list(map(int,input().split()))
money=1000
k=0
row=0
high=0

for i in range(N-1):
  if A[i]<A[i+1]:
    row=min(A[k:i+1])
    k=i+1
  if A[i]>A[i+1]:
    high=max(A[k:i+1])
    k=i+1
    if row==0:
      continue
    div,mod=divmod(money,row)
    money=div*high+mod
  if i==N-2:
    high=max(A[k:])
    if row==0:
      continue
    div,mod=divmod(money,row)
    money=div*high+mod
print(money)
    
  
  