#include <bits/stdc++.h>
int n, k, a[102], sum = 0;
int main() {
  scanf("%d%d", &n, &k);
  int i, j;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]), sum += a[i];
  int ans = 2 * k * n - n - 2 * sum;
  printf("%d", ans < 0 ? 0 : ans);
  return 0;
}
