N = int(input())
A = list(map(int, input().split()))
K = [0]*N
s = 1000
kab = 0

if A[0] < A[1]:
  K[0] = -1
elif A[0] > A[1]:
  K[0] = 1
for i in range(1, N):
  if A[i-1] < A[i]:
    K[i] = 1 # 1は最高値
    if K[i-1] == 1: 
      K[i-1] == 0
  elif A[i-1] > A[i]:
    K[i] = -1 # -1は最低値
    if K[i-1] == -1:
      K[i-1] == 0
#print(K)
M = list(K)
for i in range(N):
  a = M.pop()
  if a == 1:
    break
  elif (a == -1):
    K[-i] = 0

#print(K)
  
for i in range(N):
  if K[i] == -1:
    kab = s // A[i]
    s -= A[i]*kab
  elif K[i] == 1:
    s += A[i]*kab
    kab = 0
print(s)
    
    
    
