#include <bits/stdc++.h>
using namespace std;
vector<int> a, d;
int n, Min = -1;
int getans() {
  if (n == 0) return 0;
  if (n >= Min) {
    int ans = 0;
    int m = n;
    for (int i = n - 1; i >= n - Min; i--, m--) ans += a[i];
    n = m;
    if (n > 1)
      n -= 2;
    else if (n > 0)
      n -= 1;
    return getans() + ans;
  } else {
    int ans = 0;
    for (int i = 0; i < n; i++) ans += a[i];
    n = 0;
    return ans;
  }
}
int main() {
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int q;
    cin >> q;
    if (Min == -1 || q < Min) Min = q;
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    int el;
    cin >> el;
    a.push_back(el);
  }
  sort(a.begin(), a.end());
  cout << getans() << endl;
}
