#include <bits/stdc++.h>
using namespace std;
const int mod1 = 1e9 + 7;
void solve() {
  int m;
  cin >> m;
  int q[m];
  int t = 1000000;
  for (int i = 0; i < m; ++i) {
    cin >> q[i];
    t = min(t, q[i]);
  }
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  int s[n + 1];
  s[0] = 0;
  for (int i = 1; i <= n; ++i) {
    s[i] = s[i - 1] + a[i - 1];
  }
  int dp[n + 1];
  for (int i = 0; i < n + 1; ++i) {
    dp[i] = s[i];
  }
  for (int i = 1; i <= n; i++) {
    if (i >= t) dp[i] = min(dp[i], dp[i - t] + s[i] - s[i - t]);
    if (i >= t + 1) dp[i] = min(dp[i], dp[i - t - 1] + s[i] - s[i - t]);
    if (i >= t + 2) dp[i] = min(dp[i], dp[i - t - 2] + s[i] - s[i - t]);
  }
  cout << dp[n] << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
