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