#include <bits/stdc++.h>
using namespace std;
int m, q, mq = INT_MAX, n, a[100007], res;
int main() {
  cin >> m;
  for (int i = 1; i <= m; ++i) cin >> q, mq = min(mq, q);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1, greater<int>());
  int i;
  for (i = 1; i + mq <= n; i += (mq + 2))
    for (int j = i; j <= i + mq - 1; ++j) res += a[j];
  for (; i <= n; ++i) res += a[i];
  cout << res;
  return 0;
}
