#include <bits/stdc++.h>
using namespace std;
int price[100050];
void init() { memset(price, 0, sizeof(price)); }
int main() {
  init();
  int m, n;
  int mini, tmp;
  long long sum = 0;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    cin >> tmp;
    if (i == 0) mini = tmp;
    if (tmp < mini) mini = tmp;
  }
  cin >> n;
  for (int j = 0; j < n; ++j) cin >> price[j];
  sort(price, price + n);
  while (n > 0) {
    for (int k = 0; k < mini && n - k - 1 >= 0; k++) sum += price[n - k - 1];
    n = n - mini - 2;
  }
  cout << sum << endl;
  return 0;
}
