#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long m;
  cin >> m;
  long long val;
  long long co = INT_MAX;
  for (int i = 0; i < m; ++i) {
    cin >> val;
    co = min(co, val);
  }
  long long n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long inbasket = 0, ans = 0;
  for (int i = n - 1; i >= 0; --i) {
    inbasket++;
    ans += a[i];
    if (inbasket == co) {
      inbasket = 0;
      i -= 2;
    }
  }
  cout << ans;
}
