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