#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long M;
  cin >> M;
  vector<long long> v;
  for (long long i = 0; i < M; i++) {
    long long k;
    cin >> k;
    v.push_back(k);
  }
  long long m = *min_element(v.begin(), v.end());
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  reverse(a, a + n);
  long long i = 0;
  long long sum = 0;
  while (i < n) {
    long long j = m;
    while (j > 0 && i < n) {
      sum += a[i++];
      j--;
    }
    i += 2;
  }
  cout << sum;
}
