#include <bits/stdc++.h>
using namespace std;
int a[100005], n;
int main() {
  scanf("%d", &n);
  int t = 1000000, k;
  for (int i = 1; i <= n; ++i) scanf("%d", &k), t = min(t, k);
  int ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]), ans += a[i];
  t += 2;
  sort(a, a + n);
  for (int i = 0; i < n; ++i)
    if ((n - i) % t == 0 || (n - i) % t == t - 1) ans -= a[i];
  printf("%d", ans);
  return 0;
}
