'use strict'

function main(s) {

  s = s.split('\n');
  const x = Number(s[0].split(' ')[2]);
  const a = s[1].split(' ').map(x => Number(x));
  const toN = a.filter(num => x < num).length;
  const to0 = a.filter(num => x > num).length;
  const ans = Math.min(to0, toN);

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
