local N, M, X = io.read("*n", "*n", "*n")
local A = {}
for i = 1, M do
    A[i] = io.read("*n")
end

local left = 0
local right = 0
for i = 1, N+1 do
    for j = 1, M do
        if i == A[j] and X < i then
            right = right + 1
        elseif i == A[j] and X > i then
            left = left + 1
        end
    end
end

print(math.min(left, right))