n = gets.to_i
arr = []
n.times do
  arr << gets.chomp.to_i
end
answer = []
arr.each do |i|
  if i == 0
    answer << [i]
    next
  end
  merged = false
  answer.each do |_arr|
    if _arr[-1] < i
      _arr << i
      merged = true
      break
    end
  end
  answer << [i] unless merged
end
p answer.length
