#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
bool cmp(long long a, long long b) { return a > b; }
long long prem[maxn], preu[maxn];
long long totm = 0, totu = 0;
long long mrr[maxn], urr[maxn];
int main() {
  long long n, d, m;
  scanf("%lld %lld %lld", &n, &d, &m);
  long long val;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &val);
    if (val > m)
      mrr[totm++] = val;
    else
      urr[totu++] = val;
  }
  sort(mrr, mrr + totm, cmp);
  sort(urr, urr + totu, cmp);
  prem[0] = mrr[0], preu[0] = urr[0];
  for (int i = 1; i < totm; i++) prem[i] = prem[i - 1] + mrr[i];
  for (int i = 1; i < n; i++) preu[i] = preu[i - 1] + urr[i];
  long long ans = 0;
  if (totu == n) ans = preu[totu - 1];
  for (int i = 1; i <= totm; i++) {
    long long delay = (i - 1) * (d + 1) + 1;
    if (delay > n) break;
    long long res = prem[i - 1];
    ans = max(ans, preu[n - delay - 1] + res);
  }
  printf("%lld\n", ans);
  return 0;
}
