local N, M, X = io.read("n","n","n")
local G = {}
for i=1,M do
  G[io.read("n")] = true
end
local left = 0
for i=X,0,-1 do
  if G[i] then
    left = left + 1
  end
end
local right = 0
for i=X,N do
  if G[i] then
    right = right + 1
  end
end
print(math.min(left,right))