#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:666000000")
using namespace std;
const int inf = (1 << 30) - 1;
const long double eps = 1e-9;
const long double pi = fabs(atan2(0.0, -1.0));
void ML() {
  int *ass;
  for (;;) {
    ass = new int[2500000];
    for (int i = 0; i < 2500000; i++) ass[i] = rand();
  }
}
int m, n;
int a[100500];
int q[100500];
void LoAd() {
  cin >> m;
  for (int i = 0; i < m; i++) scanf("%d", &q[i]);
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
}
int sv[100500];
int sums[100500];
int rec(const int v) {
  if (v < 0) return 0;
  if (-1 != sv[v]) return sv[v];
  int bres = 1000000000;
  int imax = min(100, m);
  for (int i = 0; i < 1; i++) {
    if (v - q[i] < -1) continue;
    int res = 0;
    for (int j = 0; j < q[i]; j++) res += a[v - j];
    {
      int tres = rec(v - q[i] - 2);
      bres = min(bres, res + tres);
    }
  }
  if (bres == 1000000000) {
    bres = sums[v];
  }
  return sv[v] = bres;
}
void SoLvE() {
  memset(sv, -1, sizeof(sv));
  sort(q, q + m);
  sort(a, a + n);
  sums[0] = a[0];
  for (int i = 1; i < n; i++) sums[i] = sums[i - 1] + a[i];
  long long res = rec(n - 1);
  cout << res;
}
int main() {
  srand((int)time(NULL));
  LoAd();
  SoLvE();
  return 0;
}
