#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, m;
  cin >> n >> d;
  int temp;
  int *a = new int[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  cin >> m;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (a[i] > a[j]) {
        temp = a[i];
        a[i] = a[j];
        a[j] = temp;
      }
  for (int i = m; i < n; i++) a[i] = 0;
  int sum = 0;
  for (int i = 0; i < n; i++) sum += a[i];
  if (m > n) sum -= d * (m - n);
  cout << sum;
}
