#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, d, m, a, res = 0;
  cin >> n >> d;
  vector<int> A;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    A.push_back(a);
  }
  sort(A.begin(), A.end());
  cin >> m;
  for (int i = 0; i < m; ++i) {
    if (i < n)
      res += A[i];
    else
      res -= d;
  }
  cout << res;
}
