#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, ans = 0, c = 0, min_disc, sum = 0;
  scanf("%d", &m);
  vector<int> a(m);
  for (int i = 0; i < m; i++) scanf("%d", &a[i]);
  scanf("%d", &n);
  vector<int> b(n);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  sort(a.begin(), a.end());
  min_disc = a[0];
  sort(b.begin(), b.end());
  for (int i = n - 1; i > -1;) {
    sum += b[i], c++;
    if (c == min_disc)
      c = 0, i -= 3;
    else
      i--;
  }
  cout << sum << endl;
  return 0;
}
