#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, i, j = INT_MAX, k, x, y, z, m, sum = 0;
  cin >> m;
  int q[m + 1];
  q[0] = 0;
  for (i = 1; i <= m; i++) {
    cin >> q[i];
    j = min(j, q[i]);
  }
  cin >> n;
  int d[n + 1];
  for (i = 1; i <= n; i++) {
    cin >> d[i];
    sum += d[i];
  }
  d[0] = 0;
  sort(d, d + n + 1);
  i = n;
  bool ok = false;
  x = 0;
  y = 0;
  for (i = n; i >= 1; i--) {
    if (ok == false)
      x += 1;
    else {
      sum -= d[i];
      y += 1;
      if (y == 2) ok = false;
    }
    if (x == j) {
      ok = true;
      x = 0;
      y = 0;
    }
  }
  cout << sum;
  return 0;
}
