output_description: Print the minimum number of colors required to satisfy the condition.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1
      :
      A_N
attempt: N, *A = map(int, open(0).read().split())
  P = [-e for e in set(A)]
  P.sort()
  P.append(1)
  MP = {e: i for i, e in enumerate(P)}
  N += 1
  
  data = [0] * (N + 1)
  
  
  def get(k):
      r = 0
      while k:
          r += data[k]
          k -= k & -k
      return r
  
  
  def add(k, x):
      while k <= N:
          data[k] += x
          k += k & -k
  
  
  N0 = 2 ** (N - 1).bit_length()
  
  
  def lower_bound(x):
      w = i = 0
      k = N0
      while k:
          if i + k <= N and w + data[i + k] <= x:
              w += data[i + k]
              i += k
          k >>= 1
      return i + 1
  
  
  for a in A:
      j = MP[-a]
      i = lower_bound(get(j + 1))
      if i != N + 2:
          add(i, -1)
      add(j + 1, 1)
  print(get(N))
  
problem_description: Statement
  
  You are given a sequence with N integers: A = \\{ A_1, A_2, \cdots, A_N \\}.
  For each of these N integers, we will choose a color and paint the integer
  with that color. Here the following condition must be satisfied:
  
    * If A_i and A_j (i < j) are painted with the same color, A_i < A_j.
  
  Find the minimum number of colors required to satisfy the condition.
samples: [{"input": "5\n    2\n    1\n    4\n    5\n    3", "output": "2\n    \n\nWe can satisfy the condition with two colors by, for example, painting 2 and 3\nred and painting 1, 4, and 5 blue.\n\n* * *"}, {"input": "4\n    0\n    0\n    0\n    0", "output": "4\n    \n\nWe have to paint all the integers with distinct colors."}]