#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int x, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    sum += x;
  }
  if (sum / (double)n >= k - 0.5)
    cout << 0;
  else
    cout << 2 * (n * (k - 0.5) - sum);
  return 0;
}
