#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool read(T &n) {
  T x = 0, tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
  if (c == EOF) return false;
  if (c == '-') c = getchar(), tmp = -1;
  while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
  n = x * tmp;
  return true;
}
template <class T>
inline void write(T n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  int len = 0, data[20];
  while (n) {
    data[len++] = n % 10;
    n /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
}
int main() {
  int m, n, ans = 0;
  read(m);
  vector<int> q(m);
  for (auto &i : q) read(i);
  read(n);
  vector<int> a(n);
  for (auto &i : a) read(i);
  sort(q.begin(), q.end());
  sort(a.rbegin(), a.rend());
  for (int i = 0, j = 0; i < n;) {
    for (int k = 0; k < q[0] && i < n; ++i, ++k) ans += a[i];
    for (int k = 0; k < 2 && i < n; ++i, ++k) {
    }
    ++j;
  }
  write(ans);
  return 0;
}
