n = gets.to_i

as = []
n.times{
	as << gets.to_i
}

branch = []

(0 ... as.size).each{ |x|
	isExists = false

	(0...branch.size).each{ |i|
		if branch[i] < as[x] then
			branch[i] = as[x]
			isExists = true
			break
		end
	}

	if ! isExists then
		branch << as[x]
	end
}

puts branch.size
