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