#include <bits/stdc++.h>
using namespace std;
int q[200005];
int a[200005];
int main() {
  int m, n;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) scanf("%d", &q[i]);
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(q, q + m);
  sort(a, a + n);
  reverse(a, a + n);
  int c = q[0];
  int tot = 0;
  for (int i = 0; i < n; i += c) {
    for (int j = 0; j < c && i + j < n; j++) {
      tot += a[i + j];
    }
    i += 2;
  }
  cout << tot << endl;
  return 0;
}
