#include <bits/stdc++.h>
using namespace std;
int discounts[200000];
int prices[200000];
int main() {
  int N, mindisount = 100000;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> discounts[i];
    if (discounts[i] < mindisount) mindisount = discounts[i];
  }
  int K, sum = 0;
  cin >> K;
  for (int i = 0; i < K; ++i) cin >> prices[i];
  sort(prices, prices + K, greater<int>());
  for (int i = 0; i < K; i = i + 2) {
    for (int j = 0; j < mindisount && i < K; ++j, ++i) sum = sum + prices[i];
  }
  cout << sum << endl;
}
