#include <bits/stdc++.h>
using namespace std;
long long n, d, m, a[100005], b[100005], sum[100005], num[100005], cnt1, cnt2,
    use[100005];
bool cmp(long long x, long long y) { return x > y; }
signed main(void) {
  scanf("%lld%lld%lld", &n, &d, &m);
  for (long long i = 1; i <= n; i++) {
    long long x;
    scanf("%lld", &x);
    if (x > m)
      a[++cnt1] = x;
    else
      b[++cnt2] = x;
  }
  sort(a + 1, a + cnt1 + 1, cmp);
  sort(b + 1, b + cnt2 + 1, cmp);
  for (long long i = 1; i <= n; i++) {
    a[i] += a[i - 1];
    b[i] += b[i - 1];
  }
  long long ans = 0;
  for (long long i = 0; i <= n; i++) {
    ans = max(ans, b[i] + a[(n - i) / (d + 1) + (bool)((n - i) % (d + 1))]);
  }
  cout << ans;
}
