#include <bits/stdc++.h>
using namespace std;
int d[100000];
int main() {
  int a, b, c, e, k = 0, h = 0;
  cin >> a >> b;
  for (int i = 1; i <= a; i++) cin >> d[i];
  cin >> c;
  sort(d + 1, d + a + 1);
  if (c <= a) e = c;
  if (c > a) {
    h = c - a;
    e = a;
  }
  for (int i = 1; i <= e; i++) k += d[i];
  for (int i = 1; i <= h; i++) k -= b;
  cout << k << endl;
  return 0;
}
