#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, ans, m, mn, a[111111], cx, kk;
int main() {
  scanf("%d", &n);
  mn = INF;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &m);
    mn = min(mn, m);
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  sort(a, a + n);
  reverse(a, a + n);
  cx = ans = 0;
  while (cx < n) {
    kk = min(n, cx + mn);
    for (int i = cx; i < kk; ++i) ans += a[i];
    cx += mn + 2;
  }
  printf("%d", ans);
  return 0;
}
