#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int m, n, min = 100005, num, ans, i, count;
  scanf("%d", &m);
  while (m--) {
    scanf("%d", &num);
    min = min > num ? num : min;
  }
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 0, a + n);
  ans = 0;
  count = 0;
  for (i = n - 1; i >= 0; i--) {
    ans += a[i];
    count++;
    if (count == min) {
      count = 0;
      i--;
      i--;
    }
  }
  printf("%d", ans);
  return 0;
}
