#include <bits/stdc++.h>
using namespace std;
int n, m, d;
vector<int> q;
long long ans;
int main() {
  cin >> n >> d;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    q.push_back(x);
  }
  sort(q.begin(), q.end());
  reverse(q.begin(), q.end());
  cin >> m;
  while (m--) {
    if (q.empty()) {
      ans -= d;
    } else {
      ans += q.back();
      q.pop_back();
    }
  }
  cout << ans;
  return 0;
}
