#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> a(n);
  for (auto& x : a) cin >> x;
  vector<long long> small, big;
  for (long long i = 0; i < (n); i++) {
    if (a[i] > m)
      big.push_back(a[i]);
    else
      small.push_back(a[i]);
  }
  sort(big.begin(), big.end());
  reverse(big.begin(), big.end());
  sort(small.begin(), small.end());
  vector<array<long long, 2>> pref(n + 1);
  for (long long i = 0; i < (((long long)(big).size())); i++)
    pref[i + 1][0] = pref[i][0] + big[i];
  for (long long i = 0; i < (((long long)(small).size())); i++)
    pref[i + 1][1] = pref[i][1] + small[i];
  long long ans = 0;
  for (long long i = 0; i < (((long long)(small).size()) + 1); i++) {
    long long can = min(((long long)(big).size()),
                        (((long long)(big).size()) + d + i) / (d + 1));
    ans = max(ans,
              pref[((long long)(small).size())][1] - pref[i][1] + pref[can][0]);
  }
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
