#include <bits/stdc++.h>
using namespace std;
long long int ESP = 1e18;
long long int FCB = 1e9 + 7;
long long int dir[][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int m;
  cin >> m;
  long long int a[m];
  for (long long int i = 0; i < m; i++) cin >> a[i];
  long long int n;
  cin >> n;
  long long int b[n];
  for (long long int i = 0; i < n; i++) cin >> b[i];
  sort(b, b + n, greater<long long int>());
  sort(a, a + m);
  long long int zz = a[0];
  long long int idx = 0, sum = 0, dd = 0;
  while (idx < n) {
    sum += b[idx];
    dd++;
    idx++;
    if (dd == zz) dd = 0, idx += 2;
  }
  cout << sum << "\n";
  return 0;
}
