#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 3;
ll a[N], sa[N];
int main() {
  int n, d;
  ll m;
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) sa[i] = sa[i - 1] + a[i];
  int nlem = upper_bound(a + 1, a + n + 1, m) - a - 1;
  int ngtm = n - nlem;
  ll ans = sa[nlem];
  for (int i = 1; i <= ngtm; i++) {
    ll left = n - ((ll)(d + 1) * (i - 1) + 1);
    if (left < 0) break;
    ans = max(ans, sa[n] - sa[n - i] + sa[nlem] - sa[max(0ll, nlem - left)]);
  }
  cout << ans;
  return 0;
}
