#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  int a[100005], prices[100005];
  int mini = 10000000;
  cin >> m;
  for (int i = (0); i < (m); i++) {
    cin >> a[i];
    mini = min(mini, a[i]);
  }
  cin >> n;
  for (int i = (0); i < (n); i++) cin >> prices[i];
  sort(prices, prices + n);
  int ans = 0, cosas = 0;
  for (int i = n - 1; i >= 0; i--) {
    ans += prices[i];
    ++cosas;
    if (cosas == mini) {
      i -= 2;
      cosas = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
