n = gets.to_i
a = Array.new(n) { gets.to_i }
colors = []

a.each do |x|
  choice = colors.select{|c| c[0] < x }
  if choice.length > 0
    choice.max_by{|c| c[0] }[0] = x
  else
    colors.push([x])
  end
end

puts colors.length