n = gets.to_i
a = gets.split.map(&:to_i)
bef = a[0]
money = 1000
have = 0
(1...n).each do |i|
  if a[i] > a[i-1]
    have += money / a[i - 1]
    money %= a[i-1]
    money += a[i] * have
    have = 0
  end
end
puts money
    