require 'pp'

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

money = 1000
kabu = 0
# 次のほうが高ければ次に売れば損はしない
# 次のほうが安ければ次で買えば損はしない
n.times do |i|
    #pp "===="
    #pp i
    #pp money
    #pp kabu

    if i == n - 1
        # 最後は全部売る
        money += kabu * a_n[i]
        kabu = 0
        break
    end

    if a_n[i+1] > a_n[i]
        # 買い
        buy = money / a_n[i]
        kabu += buy
        money -= buy * a_n[i]
    else
        # 売れるだけ売る
        money += kabu * a_n[i]
        kabu = 0
    end
end

puts money
