#include <bits/stdc++.h>
const long long mod = (long long)1e9 + 7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long m;
  cin >> m;
  long long mn = 100000000000000;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    mn = min(mn, x);
  }
  long long ans = 0;
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  sort(v.rbegin(), v.rend());
  for (long long i = 0; i < n; i++) {
    if (i + mn <= n) {
      for (long long j = i; j < i + mn; j++) {
        ans += v[j];
      }
      i += mn;
      i++;
    } else {
      ans += v[i];
    }
  }
  cout << ans << "\n";
  return 0;
}
