#include <bits/stdc++.h>
using namespace std;
int a[100005];
map<int, int> stuff;
int main() {
  int m, n, temp;
  int sum = 0, min = 1000000;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> temp;
    if (temp < min) min = temp;
  }
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  reverse(a + 1, a + 1 + n);
  min += 2;
  for (int i = 1; i <= n; i++) {
    if (0 < (i % min) and (i % min) < (min - 1)) sum += a[i];
  }
  cout << sum;
  return 0;
}
