#include <bits/stdc++.h>
using namespace std;
double const pi = 3.1415926536;
int const N = 1000005;
int main() {
  int m;
  cin >> m;
  int q[m];
  for (int i = 0; i < m; i++) cin >> q[i];
  sort(q, q + m);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long cnt = 0, ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    ans += a[i];
    cnt++;
    if (cnt == q[0]) {
      i -= 2;
      cnt = 0;
    }
  }
  cout << ans;
}
