#include <bits/stdc++.h>
int sum(int ar[], int n);
void insertionSort(int arr[], int n);
int main(void) {
  int n, d;
  scanf("%d %d", &n, &d);
  int i, N[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &N[i]);
  }
  int m;
  scanf("%d", &m);
  insertionSort(N, n);
  if (m <= n) {
    int j, total = 0;
    for (j = 0; j < m; j++) {
      total += N[j];
    }
    printf("%d", total);
  } else {
    int j, total = 0;
    for (j = 0; j < n; j++) {
      total += N[j];
    }
    printf("%d", total - (m - n) * d);
  }
  return 0;
}
int sum(int ar[], int n) {
  int i, total = 0;
  for (i = 0; i < n; i++) {
    total += ar[i];
  }
  return total;
}
void insertionSort(int arr[], int n) {
  int i, key, j;
  for (i = 1; i < n; i++) {
    key = arr[i];
    j = i - 1;
    while (j >= 0 && arr[j] > key) {
      arr[j + 1] = arr[j];
      j--;
    }
    arr[j + 1] = key;
  }
}
