#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  int m, n, ans = 0;
  cin >> m;
  vector<int> q(m);
  for (auto &i : q) cin >> i;
  cin >> n;
  vector<int> a(n);
  for (auto &i : a) cin >> i;
  sort(q.begin(), q.end());
  sort(a.rbegin(), a.rend());
  for (int i = 0, j = 0; i < n;) {
    for (int k = 0; k < q[0] && i < n; ++i, ++k) ans += a[i];
    for (int k = 0; k < 2 && i < n; ++i, ++k) {
    }
    ++j;
  }
  cout << ans << "\n";
  return 0;
}
