#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m;
int a[N], q[N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> m;
  for (int i = 0; i < m; ++i) cin >> q[i];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(q, q + m);
  sort(a, a + n);
  int r = n - 1, res = 0;
  while (r >= 0) {
    int t = q[0];
    while (t-- > 0 && r >= 0) {
      res += a[r--];
    }
    int k = 2;
    while (k-- > 0 && r >= 0) r--;
  }
  cout << res << '\n';
  return 0;
}
