#include <bits/stdc++.h>
using namespace std;
int q[100000 + 5];
int a[100000 + 5];
int main() {
  int m, n, minq = 100000 + 1;
  cin >> m;
  for (int i = 0; i <= m - 1; i++) cin >> q[i], minq = min(minq, q[i]);
  cin >> n;
  for (int i = 0; i <= n - 1; i++) cin >> a[i];
  long long ans = 0;
  sort(a, a + n);
  int tmp = n - 1, b = 0;
  while (1) {
    if (b >= n) break;
    if (minq <= n - b) {
      for (int i = 0; i < minq; i++) {
        ans += (long long)a[tmp--];
      }
      b += minq + 2;
      tmp -= 2;
    } else {
      for (int i = tmp; i >= 0; i--) {
        ans += (long long)a[i];
      }
      b = n;
    }
  }
  cout << ans << endl;
  return 0;
}
