#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
long long int PosX[] = {0, 1, 0, -1, 1, 1, -1, -1};
long long int PosY[] = {1, 0, -1, 0, 1, -1, 1, -1};
const double PI = 4 * atan(1.0);
void Solve(long long int test) {
  long long int m, n;
  cin >> m;
  vector<long long int> discounts(m);
  for (long long int i = 0; i < m; ++i) cin >> discounts[i];
  cin >> n;
  vector<long long int> items(n);
  for (long long int i = 0; i < n; ++i) cin >> items[i];
  sort(discounts.begin(), discounts.end());
  sort(items.begin(), items.end());
  long long int basket = discounts.front();
  long long int total = 0;
  for (long long int i = n - 1; i >= 0;) {
    if (i < basket) {
      while (i >= 0) {
        total += items[i--];
      }
      break;
    }
    for (long long int c = 0; i >= 0 && c < basket; --i, ++c) {
      total += items[i];
    }
    for (long long int c = 0; i >= 0 && c < 2; --i, ++c) {
    }
  }
  cout << total << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(20);
  long long int t = 1;
  for (long long int test = 1; test <= t; ++test) {
    Solve(test);
  }
  return 0;
}
