#include <bits/stdc++.h>
using namespace std;
bool visited[1005][1005];
int xr[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int yc[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int rr[] = {0, -1, 0, 1};
int cc[] = {-1, 0, 1, 0};
int ary[102][102];
int main() {
  int dis[100005], need[100005];
  int m, n;
  while (~scanf("%d", &m)) {
    for (int i = 0; i < m; i++) scanf("%d", dis + i);
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", need + i);
    sort(dis, dis + m);
    sort(need, need + n, greater<int>());
    int dorkar = n, c = dis[0];
    int sum = 0, i = 0;
    while (i < n) {
      if (i + c <= n) {
        for (int j = i; j < i + c; j++) {
          sum += need[j];
        }
        i += c;
        i += 2;
      } else {
        for (int j = i; j < n; j++) sum += need[j];
        break;
      }
    }
    printf("%d\n", sum);
  }
  return 0;
}
