#include <bits/stdc++.h>
using namespace std;
int m, n, a[200000], b[200000];
long long ans, i, j, q;
int main() {
  cin >> m;
  for (i = 1; i <= m; i++) cin >> b[i];
  sort(b + 1, b + m + 1);
  q = b[1];
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (i = n; i - q + 1 >= 1; i -= q + 2)
    for (j = i; j >= i - q + 1; j--) ans += a[j];
  for (; i >= 1; i--) ans += a[i];
  cout << ans << endl;
}
