n = read_line.to_i
a = read_line.split.map &.to_i
money, kabu = 1000, 0
n.times do |i|
  if i + 1 < n && a[i] > a[i + 1] || i + 1 == n
    money += kabu * a[i]
    kabu = 0
  elsif i + 1 < n && a[i] < a[i + 1]
    buy = money // a[i]
    money -= buy * a[i]
    kabu += buy
  end
end
puts money