n = gets.to_i
a = gets.split.map(&:to_i)

dp = Array.new(n+1) {[0,0,0,0]}
dp[0] = [1000, 0, 0, 0]

n.times do |i|
    dp[i+1][0] = [dp[i][0], dp[i][2] + a[i] * dp[i][3]].max

    if dp[i][0] / a[i] > dp[i][2] / a[i] + dp[i][3]
        dp[i+1][2] = dp[i][0] % a[i]
        dp[i+1][3] = dp[i][0] / a[i]
    else
        dp[i+1][2] = dp[i][2] % a[i]
        dp[i+1][3] = dp[i][3] + dp[i][2] / a[i]
    end
end

puts dp[n][0]