#include <bits/stdc++.h>
using namespace std;
const int MaxN = 100224;
int n, m;
int a[MaxN], q[MaxN];
int main() {
  cin.sync_with_stdio(0);
  cin >> m;
  for (int i = 0; i < m; i++) cin >> q[i];
  sort(q, q + m);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  reverse(a, a + n);
  int inbasket = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    inbasket++;
    if (inbasket == q[0]) {
      inbasket = 0;
      i += 2;
    }
  }
  cout << sum << endl;
  return 0;
}
