#include <bits/stdc++.h>
using namespace std;
void swap(int &a, int &b) {
  int c = a;
  a = b;
  b = c;
}
void solve() {
  int n, m;
  cin >> m;
  vector<int> s(m);
  for (auto &b : s) cin >> b;
  cin >> n;
  vector<int> a(n);
  for (auto &c : a) cin >> c;
  sort(a.begin(), a.end());
  sort(s.begin(), s.end());
  int num = s[0];
  int ans = 0;
  int cnt = s[0];
  bool rest = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (cnt > 0) {
      ans += a[i];
      cnt--;
    } else if (cnt > -2) {
      cnt--;
    }
    if (cnt == -2) cnt = s[0];
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t = 1;
  while (t--) solve();
}
