lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]
Inf = 10 ** 10

trade = []
for i in 1..N do
  trade.push(0)
end

price = lines[1].clone

money = 1000
for i in 1..N do
  if i != N and price[i-1] < price[i] then
    money = (money / price[i-1]) * price[i] + (money % price[i-1])
  end
end
  
puts money