#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int OO = (int)1e8;
const int dx[] = {0, 1, -1, 0};
const int dy[] = {1, 0, 0, -1};
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long fast_power(long long base, long long power) {
  long long res = 1;
  while (power) {
    if (power & 1) res = (res * base) % mod;
    base = (base * base) % mod;
    power /= 2;
  }
  return (res % mod);
}
void in_out_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
map<string, int> mp;
string solve(long long n) {
  long long x = n;
  int re;
  string str = "";
  while (n) {
    re = n % 10;
    n /= 10;
    if (re % 2)
      str += '1';
    else
      str += '0';
  }
  reverse(str.begin(), str.end());
  while (str.size() < 18) str = '0' + str;
  return str;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, x, y, one = 0, two = 0, three = 0;
  cin >> n >> x;
  for (int i = 0; i < n; i++) {
    cin >> y;
    if (y > x)
      one++;
    else if (y < x)
      two++;
    else
      three++;
  }
  if (one > two) {
    if (two + three >= one)
      cout << 0 << endl;
    else
      cout << one - (two + three) << endl;
  } else if (two > one) {
    if (one + (three - 1) >= two)
      cout << 0 << endl;
    else
      cout << two - (one + (three - 1)) << endl;
  } else {
    if (three == 0)
      cout << 1 << endl;
    else
      cout << 0 << endl;
  }
  return 0;
}
