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

money = 1000
urine = 0
kabu = 0 
n = 0
mode = ""

if N == 2 and A[0] == A[1] :
  print("1000")
  sys.exit()

if A[0] < A[1] :
  mode = "up"
  urine = A[0]
  kabu = money // urine
  money = money - kabu*urine
elif A[0] > A[1] :
  mode = "down"
else :
  while A[n] == A[n + 1]:
    if n + 2 > N :
      print("1000")
      sys.exit()
      
    if A[n + 1] < A[n + 2]:
      mode = "up"
      urine = A[n + 1]
      kabu = money // urine
      money = money - kabu*urine
      break
    elif A[n + 1] > A[n + 2]:
      mode ="down"
      break
    
    n += 1  

for i in range(N-1):
  if mode == "up" :
    if A[i] <= A[i + 1] :
      next
    elif A[i] > A[i +1] :
      mode = "down"
      money = money + kabu*A[i]

  elif mode == "down":
    if A[i] >= A[i + 1] :
      next
    elif A[i] < A[i +1] :
      mode = "up"
      urine = A[i]
      kabu = money // urine
      money = money - kabu * urine
      
if mode == "up" :
  print(money + A[N-1]*kabu)
else :
  print(money)
