N = gets.chomp.to_i
arr = readlines.map{|n| n.chomp.to_i}
color = []
# p N,arr

color = {}
c_i = 1
arr.each do |n|
    if color.size == 0
        color[c_i]=n
        next
    end
    sorted_hash =  color.sort{|a,b| b[1]<=>a[1]}
    key = nil
    sorted_hash.each do |k,v|
        if v < n
            key = k
            break
        end
    end
    if not key.nil?
        color[key] = n
    else
        c_i += 1
        color[c_i]=n
    end
    # p color
end
puts color.size