#include <bits/stdc++.h>
using namespace std;
int n, m, q = 0x7fffffff;
int a[100010], sum[100010], ans;
int cmp(const int& a, const int& b) { return a > b; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int k;
    scanf("%d", &k);
    q = min(q, k);
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", a + i);
  }
  sort(a + 1, a + 1 + m, cmp);
  for (int i = 1; i <= m; i++) {
    sum[i] = a[i] + sum[i - 1];
  }
  for (int i = 1; i <= m; i++) {
    int j = min(i + q - 1, m);
    ans += sum[j] - sum[i - 1];
    i = j + 2;
  }
  printf("%d\n", ans);
  return 0;
}
