#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e = 100002, i, j, x[100002], y[100002], z;
int main() {
  cin >> a;
  for (i = 0; i < a; i++) {
    cin >> x[i];
    if (x[i] < e) e = x[i];
  }
  cin >> b;
  for (i = 0; i < b; i++) cin >> y[i];
  sort(y + 0, y + b);
  c = b - 1;
  while (b >= e) {
    for (j = c; j > c - e; j--) z += y[j];
    c -= e;
    if (b >= e + 2) {
      b = b - e - 2;
      c = c - 2;
    } else {
      if (b >= e + 1) {
        b = b - e - 1;
        c--;
      } else
        b = b - e;
    }
  }
  if (b > 0) {
    for (i = 0; i < b; i++) z += y[i];
  }
  cout << z;
  return 0;
}
