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