#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10;
long long raw[maxn];
vector<long long> sufa, sufb;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, d, m;
  cin >> n >> d >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> raw[i];
  }
  sufb.push_back(0);
  sort(raw + 1, raw + n + 1);
  reverse(raw + 1, raw + n + 1);
  for (long long i = 1; i <= n; i++) {
    if (raw[i] > m)
      sufb.push_back(raw[i]);
    else
      sufa.push_back(raw[i]);
  }
  for (long long i = 1; i < sufa.size(); i++) sufa[i] += sufa[i - 1];
  for (long long i = 1; i < sufb.size(); i++) sufb[i] += sufb[i - 1];
  long long ans = 0;
  for (long long i = 0; i <= n; i++) {
    long long vaib = min((n - i + d) / (d + 1), (long long)(sufb.size()));
    long long tmp = 0;
    if (sufb.size()) tmp += sufb[vaib];
    if (i and i - 1 < sufa.size()) tmp += sufa[i - 1];
    ans = max(ans, tmp);
  }
  cout << ans;
  return 0;
}
