#abc094b. [abc094_b]Toll Gates

[abc094_b]Toll Gates

Problem Statement

There are N+1N + 1 squares arranged in a row, numbered 0,1,...,N0, 1, ..., N from left to right.

Initially, you are in Square XX. You can freely travel between adjacent squares. Your goal is to reach Square 00 or Square NN. However, for each i=1,2,...,Mi = 1, 2, ..., M, there is a toll gate in Square AiA_i, and traveling to Square AiA_i incurs a cost of 11. It is guaranteed that there is no toll gate in Square 00, Square XX and Square NN.

Find the minimum cost incurred before reaching the goal.

Constraints

  • 1leqNleq1001 \\leq N \\leq 100
  • 1leqMleq1001 \\leq M \\leq 100
  • 1leqXleqN11 \\leq X \\leq N - 1
  • 1leqA1<A2<...<AMleqN1 \\leq A_1 < A_2 < ... < A_M \\leq N
  • AineqXA_i \\neq X
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN MM XX A1A_1 A2A_2 ...... AMA_M

Output

Print the minimum cost incurred before reaching the goal.


Sample Input 1

5 3 3
1 2 4

Sample Output 1

1

The optimal solution is as follows:

  • First, travel from Square 33 to Square 44. Here, there is a toll gate in Square 44, so the cost of 11 is incurred.
  • Then, travel from Square 44 to Square 55. This time, no cost is incurred.
  • Now, we are in Square 55 and we have reached the goal.

In this case, the total cost incurred is 11.


Sample Input 2

7 3 2
4 5 6

Sample Output 2

0

We may be able to reach the goal at no cost.


Sample Input 3

10 7 5
1 2 3 4 6 8 9

Sample Output 3

3