#include <bits/stdc++.h>
using namespace std;
long long gCd(long long a, long long b) {
  if (b == 0) return a;
  return gCd(b, a % b);
}
long long fact(long long n) {
  long long res = 1;
  for (long long i = 2; i <= n; i++) res = (res * i) % 1000000007;
  return res;
}
long long nCr(long long n, long long r) {
  return fact(n) / (fact(r) * fact(n - r));
}
int32_t main() {
  long long m;
  cin >> m;
  long long min_discount = INT64_MAX;
  for (long long i = 0; i < m; i++) {
    long long x;
    cin >> x;
    if (x < min_discount) min_discount = x;
  }
  long long n;
  cin >> n;
  vector<long long> arr;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    arr.push_back(x);
  }
  sort(arr.begin(), arr.end());
  long long count = 0, result = 0;
  bool bought = false;
  long long i = arr.size() - 1;
  while (count != n) {
    if (bought == false) {
      long long cnt = 0;
      while (cnt < min_discount & i >= 0) {
        result += arr[i];
        i--;
        cnt++;
        count++;
      }
      if (cnt != min_discount) {
        break;
      }
      bought = true;
    } else {
      long long cnt = 0;
      while (cnt < 2 & i >= 0) {
        i--;
        cnt++;
        count++;
      }
      if (cnt != 2) {
        break;
      }
      bought = false;
    }
  }
  cout << result;
  return 0;
}
