#include <bits/stdc++.h>
using namespace std;
long long n, c = 1, j, k, l, sum = 0, flag = 0, ans = 0, m, t, b, i, a[100005];
vector<long long int> v;
string s;
int main() {
  cin >> m;
  for (i = 0; i < m; i++) cin >> a[i];
  k = *min_element(a, a + m);
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n, greater<long long>());
  for (i = 0; i < n;) {
    for (j = i; j - i + 1 <= k && j < n; j++) ans += a[j];
    i = j;
    i += 2;
  }
  cout << ans << '\n';
}
