#include <bits/stdc++.h>
using namespace std;
int n, d, m, precios[105];
int main() {
  scanf("%d %d", &n, &d);
  memset(precios, 0, sizeof(precios));
  for (int i = 0; i < n; i++) scanf("%d", &precios[i]);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (precios[i] > precios[j]) {
        int temp = precios[i];
        precios[i] = precios[j];
        precios[j] = temp;
      }
  scanf("%d", &m);
  int total = 0;
  for (int i = 0; i < m; i++) total += precios[i];
  if (m > n) total -= d * (m - n);
  printf("%d\n", total);
  return 0;
}
