#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void see(T&... args) {
  ((cin >> args), ...);
}
template <typename... T>
void put(T&&... args) {
  ((cout << args << " "), ...);
  cout << '\n';
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << "=" << a << ", ";
  err(++it, args...);
}
const long long inf = INT_MAX;
const long double ep = 0.0000001;
const long double pi = acos(-1.0);
const long long md = 1000000007;
void solve() {
  long long m;
  see(m);
  long long a[m];
  for (long long i = 0; i < m; ++i) see(a[i]);
  sort(a, a + m);
  long long n;
  see(n);
  long long b[n];
  for (long long i = 0; i < n; ++i) see(b[i]);
  sort(b, b + n);
  long long r = n - 1, c = 0;
  while (r >= 0) {
    long long x = 0;
    while (x < a[0] && r >= 0) {
      c += b[r];
      r--;
      x++;
    }
    r -= 2;
  }
  cout << c;
}
signed main() {
  ios_base::sync_with_stdio(false);
  solve();
}
