#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int m, n, q = 1e9 + 7, x, ans = 0;
  cin >> m;
  while (m--) {
    cin >> x;
    q = min(q, x);
  }
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end(), cmp);
  int k = n / (q + 2), mk = n % (q + 2), c = 0;
  k *= 2;
  if (mk == q + 1) k++;
  for (int i = 0; i < n; i++) {
    if (c < q) ans += a[i];
    c++;
    c %= q + 2;
  }
  cout << ans;
  return 0;
}
