#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, flag = 0, sum = 0;
  int a[100001], q[100001];
  scanf("%d", &m);
  for (int i = 0; i < m; i++) scanf("%d", &q[i]);
  scanf("%d", &n);
  for (int j = 0; j < n; j++) scanf("%d", &a[j]);
  sort(q + 0, q + m);
  sort(a + 0, a + n);
  n--;
  while (1) {
    for (int k = 0; k < q[0]; k++) {
      sum = sum + a[n];
      n--;
      if (n < 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      break;
    }
    n = n - 2;
    {
      if (n < 0) {
        break;
      }
    }
  }
  cout << sum;
  return 0;
}
