output_description: Print the minimum cost incurred before reaching the goal.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M X
      A_1 A_2 ... A_M
attempt: N, M, X = map(int, input().split())
  n = list(map(int, input().split()))
  Ni = list(range(N, X, -1))
  Nk = list(range(0, X))
  Ni_set = set(Ni)
  Nk_set = set(Nk)
  n_set = set(n)
  Ni_ten = list(Ni_set & n_set)
  Nk_ten = list(Nk_set & n_set)
  if len(Ni_ten) < len(Nk_ten):
      print(len(Ni_ten))
  else:
      print(len(Nk_ten))
  
problem_description: Statement
  
  There are N + 1 squares arranged in a row, numbered 0, 1, ..., N from left to
  right.
  
  Initially, you are in Square X. You can freely travel between adjacent
  squares. Your goal is to reach Square 0 or Square N. However, for each i = 1,
  2, ..., M, there is a toll gate in Square A_i, and traveling to Square A_i
  incurs a cost of 1. It is guaranteed that there is no toll gate in Square 0,
  Square X and Square N.
  
  Find the minimum cost incurred before reaching the goal.
samples: [{"input": "5 3 3\n    1 2 4", "output": "1\n    \n\nThe optimal solution is as follows:\n\n  * First, travel from Square 3 to Square 4. Here, there is a toll gate in Square 4, so the cost of 1 is incurred.\n  * Then, travel from Square 4 to Square 5. This time, no cost is incurred.\n  * Now, we are in Square 5 and we have reached the goal.\n\nIn this case, the total cost incurred is 1.\n\n* * *"}, {"input": "7 3 2\n    4 5 6", "output": "0\n    \n\nWe may be able to reach the goal at no cost.\n\n* * *"}, {"input": "10 7 5\n    1 2 3 4 6 8 9", "output": "3"}]