#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, k, n, a[111111], m, q[111111], mn, ans;
  scanf("%d", &m);
  mn = 10000000;
  for (int i = 0; i < m; i++) {
    scanf("%d", &q[i]);
    mn = min(q[i], mn);
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  int i;
  i = (n - 1);
  t = mn;
  ans = 0;
  while (i >= 0) {
    if (t) {
      ans += a[i];
      t--;
    } else {
      t = mn;
      i -= 1;
    }
    i--;
  }
  cout << ans << endl;
  return 0;
}
