#include <bits/stdc++.h>
using namespace std;
int m, n;
int q[100100];
long long a[100100];
int main() {
  ios::sync_with_stdio(false);
  cin >> m;
  for (int i = 0; i < m; i++) cin >> q[i];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int real_q = 0x3f3f3f3f;
  for (int i = 0; i < m; i++)
    if (q[i] < real_q) real_q = q[i];
  sort(a, a + n);
  reverse(a, a + n);
  long long ans = 0ll;
  for (int i = 0; i < n; i += (real_q + 2)) {
    for (int j = i; j < i + real_q && j < n; j++) {
      ans += a[j];
    }
  }
  cout << ans << endl;
  return 0;
}
