#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mp;
vector<long long> v[1000000];
bool V[100005];
int n, k;
int ans = 0;
long long t[1000000];
long long t2[1000000];
int main() {
  long long n, m, ans = 0;
  cin >> m;
  for (int i = 0; i < (int)(m); i++) cin >> t[i];
  sort(t, t + m);
  cin >> n;
  for (int i = 0; i < (int)(n); i++) cin >> t2[i];
  sort(t2, t2 + n);
  long long mx = t[0];
  long long old = mx;
  for (int i = n - 1; i >= 0; i--) {
    if (old == 0) {
      i -= 1;
      old = mx;
    } else {
      ans += t2[i];
      old--;
    }
  }
  cout << ans;
}
