n = gets.chomp.to_i
alist = []
n.times do |ni|
  alist[ni] = gets.chomp.to_i
end


col = []
col[0] = alist[0]
maxcol = 0
1.upto(n-1) do |i|
  check = alist[i]
  newcol = true
  col.each_with_index do |coli,i|
    if coli < check
      col[i] = check
      col.sort!
      col.reverse!
      newcol = false
      break
    end
  end
  col.push(check) if newcol
end
puts col.size
