#include <bits/stdc++.h>
using namespace std;
int main() {
  long long arr[10000], n, d, guests, sum = 0, i;
  cin >> n >> d;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  cin >> guests;
  if (guests == n) {
    for (i = 0; i < n; i++) {
      sum += arr[i];
    }
    cout << sum << endl;
  } else if (guests < n) {
    for (i = 0; i < guests; i++) sum += arr[i];
    cout << sum << endl;
  } else {
    for (i = 0; i < n; i++) {
      sum += arr[i];
    }
    cout << sum + ((n - guests) * d) << endl;
  }
  return 0;
}
