#include <bits/stdc++.h>
using namespace std;
int arr[100005];
int main() {
  int n, m, qi = 100000, tmp;
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> tmp;
    qi = min(qi, tmp);
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  int res = 0;
  int cnt = qi;
  for (int i = n - 1; i >= 0; i--) {
    if (cnt > 0) {
      res += arr[i];
      cnt--;
    } else {
      cnt = qi;
      i--;
    }
  }
  cout << res << endl;
  return 0;
}
