import sys
import math
sys.setrecursionlimit(int(1e6))
#dprint = print
def dprint(*args):
  pass

money = 1000
stump = 0
n = list(map(int, input().split()))[0]
A = list(map(int, input().split()))
dprint('n = ', n)
dprint('A = ', A)

btm = A[0]
top = A[0]
for i in range(1, len(A)):
  dprint('i = ', i)
  a_i = A[i]
  if (money>0):
    # buy
    if a_i <= btm:
      btm = a_i
    else:
      p = money // btm
      stump = stump + p
      money = money - (p*btm)
      top = a_i
      btm = a_i
      dprint('[buy] stump, money', stump, money)
  else:
    # sell
    if a_i >= top:
      top = a_i
    else:
      money = money + (top*stump)
      stump = 0
      top = a_i
      btm = a_i
      dprint('[sell] stump, money', stump, money)

if (stump>0):
  money = money + (top*stump)
  dprint('[sell] stump, money', stump, money)

print(money)
