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

kabu = 0
bmoney = 1000
smoney = 1000

a.each{|x|
  if smoney < kabu*x + bmoney
    smoney = kabu*x + bmoney
  end
  kabu = smoney/x
  bmoney = smoney - kabu*x
}

p smoney
