import sys

def f_buy(m, s, a):
  tmp = m//a
  return m-tmp*a, s+tmp

def f_sell(m, s, a):
  return m+s*a, 0

n = int(input())
la = list(map(int, input().split()))
lb = [0]*(n-1)
for i in range(n-1):
  if la[i+1]-la[i] > 0:
    lb[i] = 1
  if la[i+1]-la[i] < 0:
    lb[i] = -1

if lb.count(1) == 0:
  print(1000)
  sys.exit()

m = 1000
s = 0
frg = 0
for i in range(n-1):
  if lb[i] == 1:
    if frg != 1:
      m, s = f_buy(m, s, la[i])
    frg = 1
  if lb[i] == -1:
    if frg != -1:
      m, s = f_sell(m, s, la[i])
    frg = -1

if lb[n-2] == 1:
  m, s = f_sell(m, s, la[n-1])
if lb[n-2] == -1:
  m, s = f_buy(m, s, la[n-1])
print(m)