#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int INF = int(1e9);
const int MAX = 100005;
long long m, n, q[MAX], a[MAX], bm = INF, res;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> q[i];
    bm = min(bm, q[i]);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n, greater<int>());
  int cur = 0;
  while (cur < n) {
    for (int i = 0; i < bm; i++) {
      if (cur < n) {
        res += a[cur];
        cur++;
      } else {
        break;
      }
    }
    cur += 2;
  }
  cout << res;
  return 0;
}
