#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d;
  cin >> n >> d;
  vector<int> arr;
  int temp;
  for (int i = 0; i < n; i++) cin >> temp, arr.push_back(temp);
  sort(arr.begin(), arr.end());
  int m;
  cin >> m;
  int profit = 0;
  for (int i = 0; i < min(n, m); i++) profit += arr[i];
  if (m > n) profit -= ((m - n) * d);
  cout << profit << "\n";
  return 0;
}
