output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A B
      P_1 P_2 ... P_N
attempt: # _*_ coding:utf-8 _*_
  #  Atcoder_AISingProgramming_Contest-B
  #  TODO https://aising2019.contest.atcoder.jp/tasks/aising2019_b
  
  
  def solveProblem(problemSeed, FirstScore, SecondScore, ScoreList):
      firstBarrier = 0
      secondBarrier = 0
      lastBarrier = 0
      for problemNo in range(0, len(ScoreList), +1):
          problemScore = ScoreList[problemNo]
          if problemScore <= FirstScore:
              firstBarrier = firstBarrier + 1
          elif (FirstScore + 1 <= problemScore) and (problemScore <= SecondScore):
              secondBarrier = secondBarrier + 1
          else:  # secondScore + 1 <= problemScore
              lastBarrier = lastBarrier + 1
      problemPattern = min(firstBarrier, secondBarrier, lastBarrier)
      answer = problemPattern
      return answer
  
  
  if __name__ == "__main__":
      N = int(input().strip())
      A, B = map(int, input().strip().split(" "))
      Ps = list(map(int, input().strip().split(" ")))
      solution = solveProblem(N, A, B, Ps)
      print("{}".format(solution))
  
problem_description: Statement
  
  You have written N problems to hold programming contests. The i-th problem
  will have a score of P_i points if used in a contest.
  
  With these problems, you would like to hold as many contests as possible under
  the following condition:
  
    * A contest has three problems. The first problem has a score not greater than A points, the second has a score between A + 1 and B points (inclusive), and the third has a score not less than B + 1 points.
  
  The same problem should not be used in multiple contests. At most how many
  contests can be held?
samples: [{"input": "7\n    5 15\n    1 10 16 2 7 20 12", "output": "2\n    \n\nTwo contests can be held by putting the first, second, third problems and the\nfourth, fifth, sixth problems together.\n\n* * *"}, {"input": "8\n    3 8\n    5 5 5 10 10 10 15 20", "output": "0\n    \n\nNo contest can be held, because there is no problem with a score of A = 3 or\nless.\n\n* * *"}, {"input": "3\n    5 6\n    5 6 10", "output": "1"}]