#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  long long n, w, s, i, y, data;
  s = 0;
  cin >> n >> w;
  for (i = 0; i < n; i++) {
    cin >> data;
    s += data;
  }
  y = 2 * n * w - n - 2 * s;
  y <= 0 ? cout << 0 : cout << y;
  return 0;
}
