#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 10;
int n;
ll d, m;
ll a[N], sum[N];
int main() {
  cin >> n >> d >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  ll tmp = 0;
  int ptr = -1;
  for (int i = 0; i < n; i++) {
    if (a[i] <= m)
      tmp += a[i];
    else {
      reverse(a, a + i);
      ptr = i - 1;
      break;
    }
  }
  sum[0] = a[0];
  for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + a[i];
  ll ans = tmp + (a[n - 1] > m ? a[n - 1] : 0), here = 0;
  for (int i = n - 1; i > ptr; i--) {
    here += a[i];
    int need = (n - i) * (d + 1) - d;
    int p = min(n - 1 - need, ptr);
    if (need > n) break;
    ans = max(ans, here + (p >= 0 ? sum[p] : 0));
  }
  printf("%lld\n", ans);
  return 0;
}
