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