#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int m, n;
  cin >> m;
  long long int discnt[m];
  for (int i = 0; i < m; i++) cin >> discnt[i];
  cin >> n;
  long long int price[n];
  for (int i = 0; i < n; i++) cin >> price[i];
  sort(discnt, discnt + m);
  sort(price, price + n, greater<int>());
  long long int sum = 0, ind = 0, jump = discnt[0];
  while (ind < n) {
    jump = discnt[0];
    while (jump--) {
      sum += price[ind++];
      if (ind == n) break;
    }
    ind += 2;
  }
  cout << sum << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
}
