#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, q[100001], a[100001], qm;
  cin >> m;
  for (int i = (0); i <= (m - 1); i++) cin >> q[i];
  sort(q, q + m);
  cin >> n;
  for (int i = (0); i <= (n - 1); i++) cin >> a[i];
  sort(a, a + n);
  qm = q[0];
  long long sum = 0;
  for (int i = n - 1, j = 0; i >= 0; i -= qm + 2)
    for (int j = i; j > i - qm && j >= 0; j--) sum += a[j];
  cout << sum << endl;
  return 0;
}
