#coding: UTF-8
import itertools
  
#2≤N≤80
#100≤Ai≤200
#入力はすべて整数


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


T = list(itertools.product(range(3), repeat=N))
#print(T[:2])

maxM = 1000

#0なにもしない　1かう 2うる
for t in T:
  M = 1000 #金
  K = 0 #株
  for i in range(len(t)):
    if t[i] == 1:
      #買う
      K += int(M/A[i])
      M = M%A[i]
    elif t[i] ==2:
      #全売り
      M += K*A[i]
      K = 0
  
  #print(M)
  maxM = max(maxM,M)
    
    
print(maxM)