#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, d, a[100], otv, i, k;
  k = 0;
  otv = 0;
  cin >> n >> d;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    k = k + a[i];
  }
  cin >> m;
  sort(a, a + n);
  if (n >= m) {
    for (i = 0; i < m; i++) otv = otv + a[i];
  } else {
    otv = k - (d * (m - n));
  }
  cout << otv << endl;
  return 0;
}
