#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k, temp, sum = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> temp;
    sum += temp;
  }
  if ((2 * n * k - 2 * sum - n) <= 0)
    cout << 0 << endl;
  else
    cout << 2 * n * k - 2 * sum - n << endl;
  return 0;
}
