process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

reader.on('close', () => {
 var nmx = lines[0].split(' ');
 var n = Number(nmx[0]);
 var m = Number(nmx[1]);
 var x = Number(nmx[2]);
 var a = lines[1].split(' ');
 var ncost = 0;
 var scost = 0;
 var compare = [];
 a = a.map(function(str) { return Number(str)});

 for(i=x; i<n; i++){
  
   if(a.indexOf(i) != -1){
     ncost++;
   }
 }
 
 for(i=x; i>0; i--){
  
   if(a.indexOf(i) != -1){
     scost++;
   }
 }

 // console.log(ncost);
 compare.push(scost);
 compare.push(ncost);

 var min = Math.min(...compare);

 console.log(min);
 
});