#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> m;
  vector<long long> q(m + 1);
  for (long long i = 1; i <= m; i++) cin >> q[i];
  cin >> n;
  vector<long long> a(n + 1);
  q[0] = 0;
  a[0] = 0;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  sort(q.begin(), q.end());
  sort(a.begin(), a.end());
  long long ans = 0;
  long long ind = n;
  long long sum[n + 1];
  sum[0] = 0;
  for (long long i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  while (ind != 0) {
    if (q[1] > ind) break;
    ans += sum[ind] - sum[ind - q[1]];
    ind = ind - q[1];
    if (ind >= 2) {
      ind -= 2;
      continue;
    }
    if (ind == 1) {
      ind = 0;
      break;
    }
    if (ind == 0) break;
  }
  if (ind == 0) {
    cout << ans;
    return 0;
  }
  for (long long i = 1; i <= ind; i++) ans += a[i];
  cout << ans;
  return 0;
}
