#include <bits/stdc++.h>
using namespace std;
const int maxn = int(1.5 * 1e7);
const int inf = 1e9 + 7;
const long long ll_inf = 1e18 + 420;
const double eps = 1e-4;
const int N = 1e6 + 7;
const int MAX = 2e5 + 9;
const int mod = 1e9 + 7;
const long double pi = 3.14159265359;
int n, m, q[N], a[N], was[N], ans;
int main() {
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> q[i];
  }
  sort(q + 1, q + m + 1);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  for (int i = n; i >= 1; i--) {
    if (!was[i]) {
      for (int j = 0; j < q[1] && i - j >= 1; j++) {
        ans += a[i - j];
        was[i - j] = 1;
      }
      if (i - q[1] - 1 >= 0) {
        was[i - q[1] - 1] = was[i - q[1]] = 1;
      }
    }
  }
  cout << ans;
}
