#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, m, q[N], a[N];
int main() {
  scanf("%d", &m);
  for (int i = (0); i < (m); ++i) scanf("%d", &q[i]);
  int mn = *min_element(q, q + m);
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i]);
  sort(a, a + n);
  int ans = 0;
  for (int i = n - 1, c = 0; i >= 0; --i) {
    ans += a[i], ++c;
    if (c >= mn) c = 0, i -= 2;
  }
  printf("%d", ans);
  return 0;
}
