#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ans = 0;
  cin >> m;
  int t = 0, mn = 1e5 + 5;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    mn = min(mn, x);
  }
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = n - 1; i >= 0; i--) {
    t++;
    if (t <= mn)
      ans += a[i];
    else if (t == mn + 2)
      t = 0;
  }
  cout << ans;
  return 0;
}
