#include <bits/stdc++.h>
int dx[] = {0, -1, 0, 1, -1, 1, -1, 1};
int dy[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int MOD = 1e9 + 7, N = 2e5 + 5;
const double pi = acos(-1);
using namespace std;
int arr[N], brr[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> m;
  for (int i = 0; i < m; i++) cin >> arr[i];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> brr[i];
  sort(arr, arr + m);
  sort(brr, brr + n, greater<int>());
  long long ans = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    cnt++;
    ans += brr[i];
    if (cnt == arr[0]) cnt = 0, i += 2;
  }
  cout << ans;
  return 0;
}
