#include <bits/stdc++.h>
const int N = 150;
int n;
int k;
int a[N];
void init() {
  std::cin >> n;
  std::cin >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
}
void work() {
  int s = 0;
  for (int i = 1; i <= n; i++) {
    s += a[i];
  }
  std::cout << std::max(0, 2 * n * k - n - 2 * s) << std::endl;
}
int main() {
  init();
  work();
  return 0;
}
