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