N = int(input())
A = list(map(int, input().split()))
kabu = 0
money = 1000
uri = 100
for i in range(N):
  if uri == i:
    money += A[j]*kabu
    kabu = 0
    continue
    
  for k in range(i+1, N):
    if A[k] > A[i]:
      kabu += money // A[i]
      money %= A[i]
      break
      
  for j in range(i+1, N):
    if j == N-1:
      uri = j
      break
      
    elif A[j+1] < A[j]:
      uri = j
      break
      
  if i == N:
    money += A[j]*kabu
    kabu = 0
  
print(money)