#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int xChange[] = {0, 1, 0, -1};
int yChange[] = {1, 0, -1, 0};
const int N = 100001;
int offers[N], prices[N], n, m, ans;
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL);
  cin >> m;
  for (int i = 0; i < m; i++) cin >> offers[i];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> prices[i];
  sort(prices, prices + n);
  sort(offers, offers + m);
  int idx = 0, first = 2, best = offers[0];
  for (int i = n - 1; i >= 0; i--) {
    if (best && first == 2) {
      ans += prices[i];
      best--;
    } else if (!best) {
      best = offers[0];
      first = 1;
    } else
      first++;
  }
  cout << ans;
  return 0;
}
