#include <bits/stdc++.h>
using namespace std;
inline void prep() {
  cin.tie(0);
  cin.sync_with_stdio(0);
};
long long mod = 1e9 + 7;
const int biggg = 1000000001;
const long long bigggest = 1000000000000000000LL;
const double eps = .1;
const double pi = acos(-1.);
int main() {
  prep();
  int m, n;
  cin >> m;
  int qs[m];
  for (int i = 0; i < m; i++) cin >> qs[i];
  sort(qs, qs + m);
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long s = 0;
  if (n < qs[0]) {
    for (int i = 0; i < n; i++) s += arr[i];
    cout << s;
    return 0;
  }
  int i = 2;
  for (i = n - 1; i >= qs[0] - 1; i += 0) {
    for (int j = i; j > i - qs[0]; j--) {
      s += arr[j];
    }
    i -= qs[0];
    for (int j = 0; j < 2 && i >= 0; j++) {
      i--;
    }
  }
  while (i >= 0) {
    s += arr[i];
    i--;
  }
  cout << s;
  return 0;
}
