#include <bits/stdc++.h>
using namespace std;
void solve() {
  int m;
  cin >> m;
  vector<int> q(m);
  for (int i = 0; i < m; i++) {
    cin >> q[i];
  }
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(q.begin(), q.end());
  sort(arr.begin(), arr.end(), greater<int>());
  int val = q[0];
  int ans = 0;
  int sum = accumulate(arr.begin(), arr.end(), 0);
  for (int i = 0; i < n; i++) {
    int ind = i % (val + 2);
    if (ind >= val) sum -= arr[i];
  }
  cout << sum << endl;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
