#include <bits/stdc++.h>
using namespace std;
bool __hack = std::ios::sync_with_stdio(false);
auto __hack1 = cin.tie(nullptr);
template <class T>
T next(istream& in) {
  T ret;
  in >> ret;
  return ret;
}
template <class T>
vector<T> nextVec(istream& in, size_t n) {
  vector<T> ret(n);
  for (size_t i = 0; i < n; ++i) {
    ret[i] = next<T>(in);
  }
  return ret;
}
void solve(istream& in, ostream& out) {
  int n_discounts = next<int>(in);
  vector<int> discounts = nextVec<int>(in, n_discounts);
  int n_goods = next<int>(in);
  vector<int> goods = nextVec<int>(in, n_goods);
  sort(discounts.begin(), discounts.end());
  sort(goods.begin(), goods.end());
  int64_t res = 0;
  for (int i = n_goods - 1; i >= 0;) {
    for (int j = i, k = 0; k < discounts[0] && j >= 0; ++k, --j, --i) {
      res += goods[i];
    }
    for (int j = 0; j < (2); ++j) {
      --i;
    }
    if (i < 0) {
      break;
    }
  }
  out << res << endl;
}
int main() {
  solve(cin, cout);
  return 0;
}
