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