#include <bits/stdc++.h>
using namespace std;
using namespace rel_ops;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int inf = 0x7FFFFFFF;
template <class T>
inline bool checkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
inline bool checkmax(T &a, T b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
void show(T a, int n) {
  for (int i = 0; i < n; ++i) cout << a[i] << ' ';
  cout << endl;
}
template <class T>
void show(T a, int r, int l) {
  for (int i = 0; i < r; ++i) show(a[i], l);
  cout << endl;
}
int q[100005], a[100005];
int main() {
  int n, m;
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) scanf("%d", q + i);
    scanf("%d", &m);
    for (int i = 0; i < m; i++) scanf("%d", a + i);
    sort(q, q + n);
    sort(a, a + m);
    int mi = q[0];
    long long ans = 0;
    int p = m - 1, t = 0;
    while (p >= 0) {
      ans += a[p];
      p--;
      t++;
      if (t % mi == 0) p -= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
