#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[int(1e5) + 100], b[int(1e5) + 100], ans;
int main() {
  cin >> m;
  for (int i = 0; i < m; ++i) cin >> a[i];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> b[i];
  sort(b, b + n);
  long long c = *min_element(a, a + m);
  for (int i = n - 1; i >= 0; i -= c + 2)
    for (int j = i; j >= 0 && j >= i - c + 1; --j) ans += b[j];
  cout << ans;
}
