#include <bits/stdc++.h>
using namespace std;
long long maxLL(long long a, long long b) { return (a > b ? a : b); }
long long minLL(long long a, long long b) { return (a < b ? a : b); }
void solve() {
  int n, d;
  cin >> n >> d;
  vector<long long> a(n), b(n, 0);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (long long i = 0; i < n; i++) {
    if (i == 0)
      b[i] = a[i];
    else
      b[i] = a[i] + b[i - 1];
  }
  int m;
  cin >> m;
  if (m <= n)
    cout << b[m - 1] << "\n";
  else {
    cout << b[n - 1] - (m - n) * d << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  cerr << "\n\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
  return 0;
}
