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