#include <bits/stdc++.h>
using namespace std;
long long int n, d, m, i, j, a[200], ans, sum;
int main() {
  cin >> n >> d;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  cin >> m;
  for (i = 1; i <= m; i++) sum += a[i];
  if (m <= n)
    cout << sum << endl;
  else
    cout << sum - (m - n) * d << endl;
  return 0;
}
