#include <bits/stdc++.h>
using namespace std;
int n, m, x, low = INT_MAX;
int main() {
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &x);
    low = min(low, x);
  }
  scanf("%d", &n);
  vector<int> arr(n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  sort(arr.begin(), arr.end());
  reverse(arr.begin(), arr.end());
  int ans = 0, it = low;
  for (int i = 0; i < n; i++) {
    if (it > 0) {
      it--;
      ans += arr[i];
    } else {
      it = low;
      i += 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
