N = gets.chomp.to_i
A = []
N.times do |i|
    A << [gets.chomp.to_i, i]
end
A.sort!
color = []
color << A.shift
A.each do |a, i|
    overwrite = color.find_index{|aa, ii| aa < a && ii < i}
    if overwrite
        color[overwrite] = [a, i]
    else
        color << [a, i]
    end
end
puts color.length