#from numba import jit

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


Money=1000
Kabu=0

#@jit
def MoneyWar(Money,Kabu,A,N):
  for i in range(N-1):
    if A[i]<A[i+1]:
      while True:
        if Money-A[i]>=0:
          Money-=A[i]
          Kabu+=1
        else:
          break
    if A[i]>A[i+1]:
      while True:
        if Kabu>0:
          Money+=A[i]
          Kabu-=1
        else:
          break

  if Kabu>0:
    Money+=Kabu*A[-1]
    
  return Money

print(MoneyWar(Money,Kabu,A,N))
