#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, k;
bool f(int tot, int num) {
  int rem = num * k - tot;
  if (rem * 2 <= num) return 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  int x = 0;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    x += t;
  }
  int ans = 0;
  while (!f(x, ans + n)) ans++, x += k;
  cout << ans << '\n';
  ;
  return 0;
}
