#include <bits/stdc++.h>
using namespace std;
int n, m;
int n1[100050];
int minn = 999999999;
int ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int t;
    scanf("%d", &t);
    minn = (minn > t ? t : minn);
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) scanf("%d", &n1[i]);
  sort(n1, n1 + m);
  int q = 1;
  for (int i = m - 1; i >= 0; i--) {
    ans += n1[i];
    if (q % (minn + 2) == minn + 1 || q % (minn + 2) == 0) ans -= n1[i];
    q++;
  }
  printf("%d", ans);
  getchar();
  getchar();
}
