#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
int m, q[M], n, a[M], ans;
int main() {
  cin >> m;
  for (int i = 1; i <= m; i++) cin >> q[i];
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(q + 1, q + m + 1);
  sort(a + 1, a + n + 1, greater<int>());
  int k = 0;
  for (int i = 1; i <= n; i++) {
    if (k >= q[1] + 2) k = 0;
    if (k >= q[1]) {
      k++;
      continue;
    }
    ans += a[i];
    k++;
  }
  cout << ans << endl;
}
