#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int N, D, M, A[MAXN + 10];
long long B[MAXN + 10];
int main() {
  scanf("%d%d%d", &N, &D, &M);
  for (int i = 1; i <= N; i++) scanf("%d", &A[i]);
  sort(A + 1, A + N + 1);
  for (int i = 1; i <= N; i++) B[i] = B[i - 1] + A[i];
  int P = 0;
  for (int i = 1; i <= N; i++)
    if (A[i] > M) P++;
  if (P == 0) return !printf("%lld\n", B[N]);
  long long val = 0, ans = 0;
  for (int i = 1; i <= P; i++) {
    val += A[N - i + 1];
    if ((long long)i * D < P - i) continue;
    long long t = (long long)D * (i - 1) - (P - i);
    if (t > N - P) continue;
    t = max(t, 0ll);
    ans = max(ans, val + B[N - P] - B[t]);
  }
  printf("%lld\n", ans);
}
