#include <bits/stdc++.h>
using namespace std;
void INPUT() {}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  INPUT();
  long long m;
  cin >> m;
  long long q[m];
  for (long long i = 0; i < m; i++) cin >> q[i];
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(q, q + m);
  sort(a, a + n);
  long long ans = 0, dis = 0, prod = q[0];
  for (long long i = n - 1; i >= 0; i--) {
    if (dis) {
      dis--;
      continue;
    }
    ans += a[i];
    prod--;
    if (prod == 0) dis = 2, prod = q[0];
  }
  cout << ans << "\n";
  return 0;
}
