n= gets.to_i
kawase = gets.strip.split.map(&:to_i)
en = 1000
kabu = 0

if n == 2
  if kawase[0] < kawase[1]
    kabu = en / kawase[0] 
    en = en % kawase[0]
    en += kabu * kawase[1]
    kabu = 0
  end
  puts en
  exit
end


(0..n-1).each do |i|
  if i <= n-3
    yogen = []
    yogen << kawase[i]
    yogen << kawase[i+1]
    yogen << kawase[i+2]
    max = yogen.max
    min = yogen.min

    if kawase[i+2] == min && kawase[i+1] > kawase[i]
      kabu = en / kawase[i] 
      en = en % kawase[i]
      en += kabu * kawase[i+1]
      kabu = 0
    elsif kawase[i+2] != min
      kabu = en / min 
      en = en % min 
      en += kabu * max
      kabu = 0
    end
  end
end

puts en