#include <bits/stdc++.h>
using namespace std;
int Cost[105] = {0};
int main() {
  int n, d, m, i, out = 0;
  cin >> n >> d;
  for (i = 0; i < n; i++) {
    cin >> Cost[i];
  }
  sort(&Cost[0], &Cost[n]);
  cin >> m;
  if (m > n) {
    out = -(d * (m - n));
    m = n;
  }
  for (i = 0; i < m; i++) {
    out += Cost[i];
  }
  cout << out;
  return 0;
}
