#include <bits/stdc++.h>
using namespace std;
static int dp[100001];
int main(int argc, char *argv[]) {
  while (true) {
    int i, j, k;
    int M = 0, N = 0;
    string s;
    getline(cin, s);
    {
      stringstream ss(s);
      ss >> M;
      if (M < 1 || M > 100000) break;
    }
    vector<int> dis;
    getline(cin, s);
    {
      stringstream ss(s);
      for (i = 0; i < M; ++i) {
        int m = 0;
        ss >> m;
        dis.push_back(m);
      }
    }
    getline(cin, s);
    {
      stringstream ss(s);
      ss >> N;
      if (N < 1 || N > 100000) break;
    }
    vector<int> items;
    getline(cin, s);
    {
      stringstream ss(s);
      for (i = 0; i < N; ++i) {
        int n = 0;
        ss >> n;
        items.push_back(n);
      }
    }
    set<int> _dis(dis.begin(), dis.end());
    vector<int> __dis(_dis.begin(), _dis.end());
    dis = __dis;
    int ds = min(3, (int)dis.size());
    sort(dis.begin(), dis.end());
    sort(items.rbegin(), items.rend());
    vector<int> sum;
    sum.push_back(0);
    for (i = 0; i < N; ++i) {
      sum.push_back(sum[i] + items[i]);
    }
    memset(dp, 0x7f, sizeof(dp));
    dp[0] = 0;
    for (i = 0; i < N; ++i) {
      dp[i + 1] = min(dp[i + 1], dp[i] + items[i]);
      for (j = 0; j < ds; ++j) {
        int c = dis[j];
        if (i + c + 1 > N) break;
        int s = sum[i + c] - sum[i];
        dp[i + c + 1] = min(dp[i + c + 1], dp[i] + s);
        if (i + c + 2 > N) continue;
        dp[i + c + 2] = min(dp[i + c + 2], dp[i] + s);
      }
    }
    int ans = dp[N];
    cout << ans << endl;
  }
  return 0;
}
