#include <bits/stdc++.h>
using namespace std;
int m, n, a[100009], minn = 100009, ans;
void findans() {
  for (int i = n - 1; i >= 0; i--) {
    if ((n - 1 - i) % (minn + 2) < minn) ans += a[i];
  }
}
int main() {
  cin >> m;
  for (int i = 0; i < m; i++) {
    int temp;
    cin >> temp;
    if (temp < minn) minn = temp;
  }
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  findans();
  cout << ans;
}
