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