n = gets.to_i
a = gets.chomp.split.map(&:to_i)
dp = Array.new(n + 1, 0)
dp[0] = 1000
stock = 0

(n - 1).times do |i|
  if a[i + 1] > a[i]
    cnt = dp[i] / a[i]
    stock += cnt
    dp[i + 1] = dp[i] - cnt * a[i]
  elsif a[i + 1] < a[i]
    dp[i + 1] = dp[i] + stock * a[i]
    stock = 0
  else
    dp[i + 1] = dp[i]
  end
end
dp[n] = dp[n - 1] + stock * a[n - 1]
puts dp.max