#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  int n, k, x;
  scanf("%d%d", &n, &k);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    sum += x;
  }
  if (2 * sum >= 2 * n * k - n)
    printf("0\n");
  else
    printf("%d\n", 2 * n * k - 2 * sum - n);
  return 0;
}
