#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
const long long INF64 = (long long)1e18;
const long double eps = 1e-9;
const long double pi = 3.14159265358979323846;
using namespace std;
int main() {
  int n, d, m;
  int sum = 0;
  cin >> n >> d;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  int sum1 = 0;
  cin >> m;
  if (m <= n) {
    for (int i = 0; i < m; i++) {
      sum1 += arr[i];
    }
    cout << sum1 << endl;
  } else {
    sum = sum - ((m - n) * d);
    cout << sum << endl;
  }
  return 0;
}
