function Main(input) {
  var mas = input[0].split(" ");
  var N = perseInt(mas[0]);
  var M = perseInt(mas[1]);
  var X = perseInt(mas[2]);
  var a = input[1];
  var A = a.split(" ");
  var L = null;
  var H = null;
  var num = null;
  var result = null;
  for (var i = 0; i < M; i++) {
    if (X > a[i]) {
      L.push(a[i] + ' ');
    } else {
      H.push(a[i] + ' ');
    }
  }
  if (H.length > L.length) {
    result = L.length;
  } else {
    result = H.length;
  }
  console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));