"use strict"

const Main = (inpuut) => {
const inputArray=inpuut.trim().split(/\n/)
const masArray=inputArray[0].split(" ").map((ele)=>{return ele-0})
const pricePlace= inputArray[1].split(" ").map((ele)=>{return ele-0})
const N= masArray[0]
const X= masArray[2] 


let result =0

if(N-X>=X){
  for (let i=X-1;i>=0;i-=1){
   
   if(pricePlace.some((ele)=>{return ele===i}))result+=1
  }
}else{
  for (let j=X+1; j<=N; j+=1){
    if(pricePlace.some((ele)=>{ return ele===j}))result+=1
  }
}
console.log(result)
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));