n = gets.to_i
a = gets.split.map(&:to_i)
money = 1000
stock = 0
(n-1).times do |i|
  if a[i] < a[i+1]
    s = money / a[i]
    money -= s * a[i]
    stock += s
  elsif a[i] > a[i+1]
    money += stock * a[i]
    stock = 0
  end
end
money += stock * a[n-1]
puts money
