#include <bits/stdc++.h>
using namespace std;
int main() {
  int NumOfHooks, Guests, Fine, total = 0;
  cin >> NumOfHooks >> Fine;
  int Costs[NumOfHooks];
  for (int i = 0; i < NumOfHooks; i++) {
    cin >> Costs[i];
    total += Costs[i];
  }
  cin >> Guests;
  sort(Costs, Costs + NumOfHooks);
  if (Guests > NumOfHooks) {
    total -= ((Guests - NumOfHooks) * Fine);
  } else if (Guests < NumOfHooks) {
    for (int i = NumOfHooks - 1; i >= Guests; i--) total -= Costs[i];
  }
  cout << total;
  return 0;
}
