#include <bits/stdc++.h>
using namespace std;
int n, m, q[100001], a[100001], mn;
int main() {
  mn = 100001;
  cin >> m;
  for (long long i = 0; i < m; i++) {
    cin >> q[i];
    mn = min(mn, q[i]);
  }
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long sum = 0;
  int i = n - 1;
  while (i >= mn) {
    for (long long j = 0; j < mn; j++) sum += a[i - j];
    i -= mn;
    i -= 2;
  }
  for (long long j = 0; j < i + 1; j++) sum += a[j];
  cout << sum << endl;
  return 0;
}
