n = gets.to_i
a = gets.split.map(&:to_i)
a.push(0)
m = 1000
s = 0
bp = 0
sp = 0
tr = -1
for i in 1..n do
  if a[i - 1] < a[i]
    if tr < 0
      bp = i - 1
    end
    tr = 1
  elsif a[i - 1] > a[i]
    if tr > 0
      sp = i - 1
#      puts "#{bp} #{sp}"
      ss = m / a[bp]
      s += ss
      m -= a[bp] * ss
#      puts "buy  #{m} #{s}"
      m += a[sp] * s
      s = 0
#      puts "sell #{m} #{s}"
    end
    tr = -1
  end
end
puts m
