#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int m;
  cin >> m;
  int discounts[100005];
  for (int i = 0; i < m; i++) cin >> discounts[i];
  sort(discounts, discounts + m);
  int n;
  cin >> n;
  int arr[100005];
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  long long sum = 0;
  int cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    sum += arr[i];
    cnt++;
    if (cnt == discounts[0]) {
      i -= 2;
      cnt = 0;
    }
  }
  cout << sum << endl;
  return 0;
}
