#include <bits/stdc++.h>
using namespace std;
int a[100005], c[100005];
int main() {
  int m, ans = 0;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
  }
  sort(c + 1, c + 1 + n);
  reverse(c + 1, c + 1 + n);
  sort(a + 1, a + 1 + m);
  int now = 1;
  while (now <= n) {
    for (int i = 1; i <= a[1]; i++) {
      ans += c[now];
      now++;
      if (now > n) break;
    }
    now += 2;
  }
  cout << ans << endl;
}
