#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int a[MAXN + 1], b[MAXN + 1];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int _min = *min_element(a, a + n);
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(b, b + m);
  reverse(b, b + m);
  vector<int> push, get;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    if ((int)push.size() < _min) {
      push.push_back(b[i]);
      ans += b[i];
    } else if ((int)get.size() < 2) {
      get.push_back(b[i]);
    } else {
      get.clear();
      push.clear();
      push.push_back(b[i]);
      ans += b[i];
    }
  }
  cout << ans << "\n";
  return 0;
}
