#include <bits/stdc++.h>
using namespace std;
int a[100];
int n, p, s, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  cin >> p;
  sort(a, a + n);
  for (int i = 0; i < p; i++) s += a[i];
  if (p <= n) {
    cout << s;
    return 0;
  }
  s += (n - p) * m;
  cout << s << endl;
  return 0;
}
