#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
int main() {
  long long n, k;
  long long s = 0;
  cin >> n >> k;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  long long r = 2 * k * n - 2 * s - n;
  if (r < 0) r = 0;
  cout << r << endl;
  return 0;
}
