#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int m, n, i, cost = 0, cnt = 0, flag = 1;
  cin >> m;
  int d[m];
  for (i = 0; i < m; i++) cin >> d[i];
  cin >> n;
  int item[n];
  for (i = 0; i < n; i++) cin >> item[i];
  sort(d, d + m);
  sort(item, item + n, greater<int>());
  for (i = 0; i < n; i++) {
    if (cnt == d[0]) {
      cnt++;
      continue;
    }
    if (cnt == d[0] + 1) {
      cnt = 0;
      continue;
    }
    cost += item[i];
    cnt++;
  }
  cout << cost << "\n";
  return 0;
}
