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