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