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