#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m, n;
  cin >> m;
  vector<int> Q(m);
  for (auto &x : Q) cin >> x;
  sort(Q.begin(), Q.end());
  cin >> n;
  vector<long long int> A(n), sum(n);
  for (auto &x : A) cin >> x;
  sort(A.begin(), A.end());
  sum[0] = A[0];
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + A[i];
  long long int ans = LLONG_MAX, current, i;
  int size = Q[0];
  i = n - 1;
  current = 0;
  while (i >= 0) {
    current += sum[i];
    i -= size;
    if (i < 0) break;
    current -= sum[i];
    i -= 2;
  }
  ans = min(ans, current);
  cout << ans << "\n";
  return 0;
}
