N, M, X = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
Z = [0] * N
for a in A:
    Z[a] = 1
lower = 0
for i in range(0, X + 1):
    lower += Z[i]
higher = 0
for i in range(X, N):
    higher += Z[i]
print(min(lower, higher))

3fbc96a5ed787ae891cfcac401019de0d3648b60
<mask token>

<mask token>
for a in A:
    Z[a] = 1
<mask token>
for i in range(0, X + 1):
    lower += Z[i]
<mask token>
for i in range(X, N):
    higher += Z[i]
print(min(lower, higher))

N, M, X = (int(x) for x in input().split())
A = [int(x) for x in input().split()]
Z = [0] * N
for a in A:
    Z[a] = 1
lower = 0
for i in range(0, X + 1):
    lower += Z[i]
higher = 0
for i in range(X, N):
    higher += Z[i]
print(min(lower, higher))
