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