#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  vector<int> q(m);
  for (int i = 0; i < m; i++) scanf("%i", &q[i]);
  sort(q.begin(), q.end());
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) scanf("%i", &a[i]);
  sort(a.rbegin(), a.rend());
  int k = 0, cnt = 0, r = q[0];
  for (int i = 0; i < n; i++) {
    if (k != 0)
      k--;
    else {
      r--;
      cnt += a[i];
      if (r == 0) {
        r = q[0];
        k = 2;
      }
    }
  }
  cout << cnt;
  return 0;
}
