#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
int n, d, m, k, l;
long long a[maxn + 5], b[maxn + 5];
void solve(long long a[], int n) {
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = (1); i <= int(n); i++) a[i] += a[i - 1];
}
int main() {
  scanf("%d %d %d", &n, &d, &m);
  for (int i = 0, x; i < n; i++) {
    scanf("%d", &x);
    if (x > m)
      a[++k] = x;
    else
      b[++l] = x;
  }
  if (k == 0) {
    long long s = 0;
    for (int i = (1); i <= int(n); i++) s += b[i];
    printf("%lld\n", s);
    exit(0);
  }
  solve(a, k);
  solve(b, l);
  fill(b + l + 1, b + n + 1, b[l]);
  long long res = 0;
  for (int i = (1); i <= int(k); i++)
    if (1ll * (i - 1) * (d + 1) + 1 <= n) {
      res = max(res, a[i] + b[n - 1ll * (i - 1) * (d + 1) - 1]);
    }
  printf("%lld\n", res);
  return 0;
}
