#include <bits/stdc++.h>
namespace {
using std::cin;
using std::cout;
using std::pair;
using std::string;
using std::vector;
}  // namespace
int main() {
  int N, X;
  cin >> N >> X;
  vector<int> A(N);
  int i = 0;
  while (i < N && cin >> A[i]) ++i;
  int l = 0, r = 0;
  int self = 1;
  for (int i = 0; i < N; ++i) {
    if (A[i] < X) {
      ++l;
    } else if (A[i] > X) {
      ++r;
    } else {
      self = 0;
    }
  }
  int d = N - l - r - 1;
  if (l < r) {
    if (d > 0) {
      if (d + l >= r - 1)
        cout << 0;
      else
        cout << r - d - l - 1;
    } else
      cout << r - l - 1 + self;
  } else {
    if (d > 0) {
      if (d + r >= l)
        cout << 0;
      else
        cout << l - r - d;
    } else
      cout << l - r + self;
  }
  return 0;
}
