#include <bits/stdc++.h>
using namespace std;
int a[100006];
int main() {
  int m;
  cin >> m;
  int p = 1e7;
  for (int i = 0; i < m; i++) {
    int b;
    cin >> b;
    p = min(p, b);
  }
  int pay = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int i = n - 1;
  int now = 0;
  while (i >= 0) {
    if (now == p) {
      i -= 2;
      now = 0;
    }
    if (i < 0) break;
    pay += a[i];
    now++;
    i--;
  }
  cout << pay << endl;
  return 0;
}
