N = gets.to_i
hash = {}
count = 0
N.times do
  val = gets.to_i
  diff = 1_000_000_001
  key = nil
  hash.each do |k,v|
    next if v >= val
    if diff > val - v
      diff = val - v
      key = k
    end
  end
  if key.nil?
    count += 1
    hash[count] = val
  else
    hash[key] = val
  end
end

puts hash.keys.count
