#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
const int N = 100007;
int n, m, a[N];
int main() {
  scanf("%d", &m);
  int q = N;
  for (int i = 0; i < m; ++i) {
    int tmp;
    scanf("%d", &tmp);
    q = min(q, tmp);
  }
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  reverse(a, a + n);
  int ans = 0;
  int pa = 0;
  while (pa < n) {
    if (n - pa >= q + 2) {
      for (int i = pa; i < pa + q; ++i) {
        ans += a[i];
      }
      pa += q + 2;
    } else if (n - pa >= q + 1) {
      for (int i = pa; i < pa + q; ++i) {
        ans += a[i];
      }
      pa += q + 1;
    } else {
      for (int i = pa; i < n; ++i) {
        ans += a[i];
      }
      pa += n - pa;
    }
  }
  cout << ans << endl;
  return 0;
}
