#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
long long binpow(long long base, long long exp, int mod) {
  long long res = 1;
  while (exp > 0) {
    if (exp % 2 == 1) res = (res * base) % mod;
    exp = exp >> 1;
    base = (base * base) % mod;
  }
  return res;
}
long long mod(long long x) {
  return ((x % 1000000007LL + 1000000007LL) % 1000000007LL);
}
long long add(long long a, long long b) { return mod(mod(a) + mod(b)); }
long long mul(long long a, long long b) { return mod(mod(a) * mod(b)); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int m;
  cin >> m;
  vector<long long int> v1;
  for (long long int i = 0; i < m; i++) {
    long long int x;
    cin >> x;
    v1.push_back(x);
  };
  sort(v1.begin(), v1.end());
  long long int n;
  cin >> n;
  vector<long long int> v2;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    v2.push_back(x);
  };
  sort(v2.begin(), v2.end());
  long long int sum = 0;
  for (int i = 0; i < n; i++) sum += v2[i];
  if (n < v1[0] + 2) {
    cout << sum << "\n";
  } else {
    long long int sum2 = 0;
    for (long long int i = n - 1; i >= 0; i -= v1[0] + 2) {
      for (long long int j = i; j >= max(i - v1[0] + 1, 0LL); j--)
        sum2 += v2[j];
    }
    cout << sum2 << "\n";
  }
  return 0;
}
