#include <bits/stdc++.h>
using namespace std;
int n, x, t1, t2, t3, a[1000], res;
int main() {
  scanf("%d", &n);
  scanf("%d", &x);
  int i, j, k;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > x)
      t3++;
    else if (a[i] < x)
      t1++;
    else
      t2++;
  }
  if (t2 == n) {
    printf("%d ", 0);
    exit(0);
  }
  res = 1000000000;
  if (t2 == 0) {
    if (t1 <= t3 - 1)
      res = t3 - t1;
    else
      res = t1 - t3 + 1;
  }
  t1--;
  t3 += t2;
  for (i = 1; i <= t2; i++) {
    t1++;
    t3--;
    if (t1 <= t3 - 1)
      res = min(res, t3 - t1 - 1);
    else
      res = min(res, t1 - t3);
  }
  printf("%d ", res);
}
