#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const double EPS = 1e-9;
int mods(int a, int b) { return (b + (a % b)) % b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m, n, a, q = INF, buy = 0, j, money = 0, A[100005];
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> a;
    q = min(q, a);
  }
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  sort(A, A + n, greater<int>());
  while (buy < n) {
    if (q <= n - buy) {
      j = buy + q;
      for (; buy < j; buy++) money += A[buy];
      buy += 2;
    } else {
      for (; buy < n; buy++) money += A[buy];
    }
  }
  cout << money << '\n';
  return 0;
}
