#include <bits/stdc++.h>
using namespace std;
int a[102];
int main() {
  int n, d, m;
  int tmp = 0;
  scanf("%d%d", &n, &d);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    tmp += a[i];
  }
  scanf("%d", &m);
  sort(a + 1, a + n + 1);
  if (m <= n) {
    int sum = 0;
    for (int i = 1; i <= m; i++) {
      sum += a[i];
    }
    printf("%d\n", sum);
  } else {
    printf("%d\n", tmp - (m - n) * d);
  }
  return 0;
}
