#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m;
  int d[m];
  for (int i = 0; i < m; ++i) cin >> d[i];
  sort(d, d + m);
  cin >> n;
  int p[n];
  for (int i = 0; i < n; ++i) cin >> p[i];
  sort(p, p + n);
  int p1 = n - 1;
  int cost = 0;
  while (p1 >= 0) {
    int foo = d[0];
    int cur = p1;
    while (foo && cur >= 0) {
      foo--;
      cost += p[cur--];
    }
    if (cur >= 0) cur--;
    if (cur >= 0) cur--;
    p1 = cur;
  }
  cout << cost << endl;
  return 0;
}
