#include <bits/stdc++.h>
using namespace std;
int n, k, m;
int a[100010];
int main() {
  int i, j;
  cin >> m;
  int minv = 100010;
  for (i = 0; i < m; i++) {
    int temp;
    cin >> temp;
    minv = min(minv, temp);
  }
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int curv = 0;
  int ans = 0;
  for (i = n - 1; i >= 0;) {
    ans += a[i];
    curv++;
    if (curv == minv) {
      curv = 0;
      i = i - 3;
    } else {
      i--;
    }
  }
  cout << ans << endl;
}
