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