#include <bits/stdc++.h>
int main() {
  int n, k, m;
  int count = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &m);
    count = count + m;
  }
  if ((double)count / n >= (k - 1) + 0.5) {
    printf("0\n");
    return 0;
  }
  int ans = 2 * k * n - n - 2 * count;
  printf("%d\n", ans);
  return 0;
}
