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


Money=1000
Kabu=0

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]

print(Money)