#include <bits/stdc++.h>
using namespace std;
ofstream fout;
FILE *outt, *inn;
ifstream fin("1.txt");
int n, d, m;
int a[101];
int main() {
  cin >> n >> d;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cin >> m;
  int sum = 0;
  sort(a, a + n);
  int i = 0;
  while (i < min(n, m)) {
    sum += a[i];
    i++;
  }
  if (m > n) {
    sum = sum - (m - n) * d;
  }
  cout << sum;
  return 0;
}
