n = gets.to_i
a = gets.split(" ").map(&:to_i)

status = [1000, 0]
n.times do |i|
  # 最終日ならば全売り
  if i+1 == n then
    status = [status[0] + a[i] * status[1], 0]
    break
  end

  if a[i] < a[i+1] then
    # 全買い
    status = [status[0] % a[i], status[1] + status[0] / a[i]]
  elsif a[i] > a[i+1] then
    # 全売り
    status = [status[0] + a[i] * status[1], 0]
  end
end

puts status[0]
