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