#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, min = 100001, x, sum = 0, a[100001];
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> x;
    if (x < min) min = x;
  }
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int i = n - 1;
  while (i >= 0) {
    for (int j = 0; j < min && i >= 0; j++) sum += a[i--];
    for (int j = 0; j < 2 && i >= 0; j++) i--;
  }
  cout << sum;
  return 0;
}
