#include <bits/stdc++.h>
using namespace std;
int offers[100000];
int arr[100000];
int main() {
  int m, n;
  cin >> m;
  int ans = 0;
  for (int i = 0; i < m; i++) {
    cin >> offers[i];
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(offers, offers + m);
  sort(arr, arr + n);
  int counter = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (counter < offers[0]) {
      counter++;
      ans += arr[i];
    } else {
      i--;
      counter = 0;
      continue;
    }
  }
  cout << ans;
  return 0;
}
