N = int(input())
A = list(map(int, input().split()))
syoji = 1000
kabu = 0
kai = 0
if N ==1:
  print(syoji)
  exit()

for i in range(N):
  if i<N-1 and kabu == 0 and A[i] < A[i+1]:
    for num in range (100000):
      if syoji < num*A[i]:
        kabu = num-1
        syoji = syoji - (num-1)*A[i]
        kai = A[i]
        break
  elif kabu > 0 and kai < A[i]:
    syoji = syoji + kabu*A[i]
    kabu = 0 

        
print(syoji)
