local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max
local n = io.read("*n")
local a = {}
for i = 1, n do
  a[i] = io.read("*n")
end
local colnum = 1
local allcol = {1}
for i = 2, n do
  local added = false
  for j = 1, colnum do
    if a[allcol[j]] < a[i] then
      added = true
      allcol[j] = i
      break
    end
  end
  if not added then
    colnum = colnum + 1
    table.insert(allcol, i)
  end
end
print(colnum)
