# D - Road to Millionaire
def is_time_to_sell(price):
  global A
  global purchase_price
  
  if purchase_price < price:
    if max(A) < price:
      return True
    else:
      is_down = False
    
      for a in A:
        if a < price:
          is_down = True
        elif price < a and is_down:
          return True
    
      return False


def sell(price):
  global money
  global stock
  
  money += price * stock
  stock = 0


def is_time_to_buy(price):
  global money
  global A
  
  if price <= money:
    if price < min(A):
      return True
    else:
      for a in A:
        if a < price:
          return False
        elif price < a:
          return True


def buy(price):
  global money
  global stock

  stock += money // price
  money %= price


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

money = 1000
stock = 0
purchase_price = 0

for i in range(N):
  a = A.pop(0)
  
  if i == N - 1:
    sell(a)
  elif is_time_to_sell(a):
    sell(a)
  elif is_time_to_buy(a):
    buy(a)
    purchase_price = a

print(money)