#include <bits/stdc++.h>
#pragma GCC optimization("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,sse4,mmx")
using namespace std;
const int inf = 1e9 + 7;
bool comp(int a, int b) {
  if (b < a)
    return 1;
  else
    return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int m, n;
  cin >> m;
  int q = inf, tmp;
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    q = min(tmp, q);
  }
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int cost = 0;
  n--;
  while (n > -1) {
    for (int i = 0; i < q; i++) {
      if (n < 0) break;
      cost += a[n];
      n--;
    }
    n -= 2;
  }
  cout << cost << '\n';
  return 0;
}
