#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
bool cmp(int c, int d) { return c > d; }
int main() {
  int n, m, res = 0, cur = 0;
  string s;
  long long r = 0;
  cin >> m;
  char c;
  for (int i = 0; i < m; ++i) {
    cin >> a[i];
  }
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  sort(a, a + m);
  sort(b, b + n, cmp);
  int i = 0;
  while (i < n) {
    for (int j = 0; j < a[0]; ++j) {
      r += b[i];
      ++i;
    }
    i += 2;
    if (i + a[0] >= n) {
      while (i < n) {
        r += b[i];
        ++i;
      }
      break;
    }
  }
  cout << r;
  return 0;
}
