#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, j, k, n, m;
  cin >> m;
  int a[m];
  for (i = 0; i < m; i++) cin >> a[i];
  sort(a, a + m);
  cin >> n;
  int p[n];
  for (i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  int ans = 0, ind = n - 1, po;
  while (ind >= 0) {
    k = a[0];
    for (po = ind; po > ind - k && po >= 0; po--) {
      ans += p[po];
    }
    ind = po - 2;
  }
  cout << ans;
  return 0;
}
