#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  float k;
  cin >> N >> k;
  float total_marks = 0;
  for (int i = 0; i < N; i++) {
    float reg_marks;
    cin >> reg_marks;
    total_marks += reg_marks;
  }
  float n = (float)N;
  if (total_marks / n >= k - 0.5) {
    cout << 0 << endl;
    return 0;
  }
  float m = -2 * (total_marks - n * (k - 0.5));
  cout << ceil(m) << endl;
  return 0;
}
