#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int arr[100005];
int main() {
  ios_base::sync_with_stdio(0);
  int m;
  cin >> m;
  int q = 100005;
  while (m--) {
    int val;
    cin >> val;
    q = min(q, val);
  }
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int i = n - 1, ans = 0;
  while (i >= 0) {
    int j = i;
    while (j >= 0 && (i - j + 1) <= q) {
      ans += arr[j];
      j--;
    }
    i = j;
    if (i >= 0) i--;
    if (i >= 0) i--;
  }
  cout << ans;
  return 0;
}
