#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int a[MAXN], small[MAXN], large[MAXN];
long long sum_small[MAXN];
int main() {
  int n, d, m;
  scanf("%d %d %d", &n, &d, &m);
  int cnt_small = 0, cnt_large = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > m) {
      large[++cnt_large] = a[i];
    } else {
      small[++cnt_small] = a[i];
    }
  }
  if (cnt_large == 0) {
    printf("%lld\n", accumulate(a + 1, a + n + 1, 0ll));
    return 0;
  }
  sort(large + 1, large + cnt_large + 1);
  sort(small + 1, small + cnt_small + 1);
  reverse(small + 1, small + cnt_small + 1);
  for (int i = 1; i <= cnt_small; i++) {
    sum_small[i] = sum_small[i - 1] + small[i];
  }
  long long ans = 0;
  cnt_large -= 1;
  n -= 1;
  long long sum_larges = 0;
  for (int larges_taken = 0; larges_taken <= min(cnt_large, n / (d + 1));
       larges_taken += 1) {
    if (larges_taken > 0) sum_larges += large[cnt_large + 1 - larges_taken];
    int smallest_deleted =
        max(0, d * larges_taken - (cnt_large - larges_taken));
    if (smallest_deleted > cnt_small) continue;
    ans = max(ans, sum_larges + sum_small[cnt_small - smallest_deleted]);
  }
  ans += large[cnt_large + 1];
  printf("%lld\n", ans);
  return 0;
}
