#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int inf = 1e9;
int main() {
  long long n, m, grt = 0, eq = 0, less = 0, i;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    if (temp == m)
      eq++;
    else if (temp < m)
      less++;
    else
      grt++;
  }
  long long ans = 0, tot;
  if (eq == 0) {
    eq++;
    ans++;
  }
  tot = less + eq + grt;
  long long temp = (tot + 1) / 2;
  if (less + eq < temp) {
    ans += grt - less - eq;
    less += grt - less - eq;
  } else if (tot - (grt + eq) > temp) {
    ans += less - eq - grt;
    grt += less - eq - grt;
  }
  tot = less + eq + grt;
  temp = (tot + 1) / 2;
  if (less == temp) ans++;
  if (grt == tot - temp + 1) ans++;
  cout << ans << endl;
  return 0;
}
