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

m = 1000
c = 0
(n - 1).times do |i|
  if arr[i] > arr[i + 1]
    m += c * arr[i]
    c = 0
  elsif arr[i] < arr[i + 1]
    c += m / arr[i]
    m = m % arr[i]
  end
end

p m + c * arr[-1]