#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> m;
  vector<int> q(m);
  for (int i = 0; i < m; ++i) cin >> q[i];
  int m0 = *min_element(q.begin(), q.end());
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a.rbegin(), a.rend());
  int res = 0, i;
  for (i = 0; i + m0 + 2 <= a.size(); i += m0 + 2) {
    res += accumulate(a.begin() + i, a.begin() + i + m0, 0);
  }
  if (i < a.size()) {
    res += accumulate(a.begin() + i, a.end(), 0);
    if (i + m0 + 1 == a.size()) res -= a.back();
  }
  cout << res << endl;
  return 0;
}
