#include <bits/stdc++.h>
using namespace std;
int a[100010];
int main() {
  int m;
  scanf("%d", &m);
  int mn = 10000000;
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    if (x < mn) mn = x;
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  long long sol = 0;
  int num = 0;
  for (int i = n - 1; i >= 0; i--) {
    sol += a[i];
    num++;
    if (num == mn) {
      num = 0;
      i -= 2;
    }
  }
  printf("%I64d\n", sol);
  return 0;
}
