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