days = int(input())
price = list(map(int,input().split()))
money = 1000
stock = 0

for i in range(days - 1):
  if price[i] < price[i + 1]:
    stock += (money // price[i])
    money -= (stock * price[i])
    
  elif price[i] > price[i + 1]:
    money += stock * price[i]
    stock = 0
  
  else:
    pass
print(money + stock * price[-1])