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