N = int(input())

A_list = [int(n) for n in input().split()]

import numpy as np

A_array = np.array(A_list)

last_num = np.min(np.where(A_array == np.max(A_array)))

if last_num == 0:
  print(1000)

else:  
  A_real = A_array[:last_num + 1]

  d_array = A_real[1:] - A_real[:-1]

  mai = int(np.floor(1000/A_real[0]))
  en = 1000
  
  for i in range(len(d_array)+1):
  
    if i == 0:
      if d_array[i] > 0:
        en += d_array[i] * mai
      
      else:
        en = en    
        
    elif i == len(d_array):
      en += d_array[i-1] * mai
    
    elif (mai != 0) & (d_array[i-1] >= 0) & (d_array[i] >= 0):
      en += d_array[i] * mai
    
    elif (d_array[i-1] >= 0) & (d_array[i] < 0):  
      mai = 0
    
    elif (mai == 0) & (d_array[i-1] <= 0) & (d_array[i] > 0):
      mai = int(np.floor(en/A_real[i]))
    else:
      mai = mai
      en = en   
      
  print(en) 