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