#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 6;
int q[maxn];
int a[maxn];
int m, n;
int main() {
  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 ans = 0;
  for (int i = n - 1; i >= 0;) {
    int qq = q[0];
    while (qq-- && i >= 0) {
      ans += a[i];
      i--;
    }
    i -= 2;
  }
  cout << ans << endl;
}
