#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
int main() {
  int T = 1, N, K, S, m, ans;
  while (T--) {
    scanf("%d%d", &N, &K);
    S = 0;
    for (int i = 0; i < N; i++) {
      scanf("%d", &m);
      S += m;
    }
    S *= 2;
    ans = 0;
    while (S < N * (2 * K - 1)) {
      S += 2 * K;
      N++;
      ans++;
    }
    printf("%d\n", ans);
  }
  return 0;
}
