#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int WHITE = 0, GRAY = 1, BLACK = 2;
const int LIM = 1e+6;
long long INF = 1e+9;
const double PI = acos(-1), EPS = 1e-7;
int n, m;
long long a[LIM], q[LIM];
int main() {
  cin >> m;
  for (int i = 0; i < m; i++) cin >> q[i];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(q, q + m);
  sort(a, a + n);
  reverse(a, a + n);
  long long ans = 0;
  int cnt = 0;
  int i = 0;
  while (i < n) {
    if (cnt == q[0]) {
      i += 2;
      cnt = 0;
    } else {
      ans += a[i];
      i++;
      cnt++;
    }
  }
  cout << ans;
  return 0;
}
