n = gets.to_i
a = []
for i in 0...n do
  a[i] = gets.to_i
end
color = []
for i in 0...n do
  flag = false
  for j in 0...color.size do
    if a[i] > color[j]
      color[j] = a[i]
      flag = true
      break
    end
  end
  if !flag
    color[color.size] = a[i]
  end
end
puts color.size
