#include <bits/stdc++.h>
using namespace std;
const int N = 100003;
int a[N];
int main() {
  int m;
  scanf("%d", &m);
  int x = (1 << 30);
  while (m--) {
    int y;
    scanf("%d", &y);
    if (x > y) x = y;
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  sort(a, a + n, greater<int>());
  int res = 0;
  for (int i = 0; i < n; ++i)
    if (i % (x + 2) < x) res += a[i];
  printf("%d\n", res);
  return 0;
}
