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

puts hash.keys.count
