#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> m;
  vector<long long> s(m);
  for (auto(i) = (0); (i) < (m); (i)++) cin >> s[i];
  cin >> n;
  vector<long long> a(n);
  for (auto(i) = (0); (i) < (n); (i)++) cin >> a[i];
  sort((a).rbegin(), (a).rend());
  long long c = 0, sk = *min_element((s).begin(), (s).end());
  for (auto(i) = (0); (i) < (n / (sk + 2)); (i)++) {
    for (auto(j) = (0); (j) < (sk); (j)++) c += a[i * (sk + 2) + j];
  }
  for (auto(i) = (0); (i) < (min(sk, n % (sk + 2))); (i)++) {
    c += a[n / (sk + 2) * (sk + 2) + i];
  }
  cout << (c) << endl;
  return 0;
}
