#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m;
  cin >> m;
  long long q[m];
  for (long long i = 0; i < m; i++) cin >> q[i];
  sort(q, q + m);
  long long mini = q[0];
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long last = n - 1;
  long long amt = 0, c = 0;
  while (last >= 0) {
    if (c < q[0]) {
      amt += arr[last];
      last--;
      c++;
    } else if (c == q[0]) {
      c = 0;
      last -= 2;
    }
  }
  cout << amt << endl;
  return 0;
}
