#include <bits/stdc++.h>
using namespace std;
int M, N, D[100005], A[100005], pre[100005];
int main() {
  cin >> M;
  for (int i = 0; i < M; i++) cin >> D[i];
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  sort(A, A + N);
  sort(D, D + M);
  pre[0] = A[0];
  for (int i = 1; i < N; i++) {
    pre[i] = pre[i - 1] + A[i];
  }
  int ans = 0, pt = N - 1;
  while (pt >= 0) {
    int dis = D[0];
    if (pt >= dis) {
      ans += pre[pt] - pre[pt - dis];
      pt -= 2 + dis;
    } else {
      ans += pre[pt];
      pt = -1;
    }
  }
  cout << ans << '\n';
}
