a = int(input())
data = list(map(int, input().split()))
l =[]
money = 1000
stock = 0
data += [0]
for i in data:
  if i not in l:
    l += [i]

diff = []
dd = []
init = 0
for i in range(len(l) - 1):
  if l[i] > l[i + 1]:
    if init == i:
      continue
    if not diff:
      mini = min(l[init:i])
      diff += [l[i] - mini]
      init = i + 1
      dd += [[l[i], mini]]
    elif diff[-1] > l[i + 1] - l[i]:
      mini = min(l[init:i])
      diff += [l[i] - mini]
      init = i + 1
      dd += [[l[i], mini]]

if sum(diff) < 0:
  print('1000')
  exit(0)
for d in dd:
  stock = money // d[1]
  money -= stock * d[1]
  money += stock * d[0]
  stock = 0
print(money)