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