#include <bits/stdc++.h>
using namespace std;
void DBG() { cerr << "]\n"; }
template <typename T, typename... Args>
void DBG(T first, Args... args) {
  cerr << first;
  if (sizeof...(args)) cerr << ", ";
  DBG(args...);
}
void solve() {
  long long n, d, m;
  cin >> n >> d >> m;
  long long arr[n];
  for (long long i = 0; i < n; ++i) cin >> arr[i];
  vector<long long> l;
  vector<long long> s(n);
  for (long long i = 0; i < n; ++i) {
    if (arr[i] > m)
      l.push_back(arr[i]);
    else
      s.push_back(arr[i]);
  }
  sort(l.rbegin(), l.rend());
  sort(s.rbegin(), s.rend());
  vector<long long> prl(n + 1);
  s.insert(s.begin(), 0);
  prl[0] = l.size() > 0 ? l[0] : 0;
  for (long long i = 1; i < n; ++i) {
    prl[i] = i < l.size() ? prl[i - 1] + l[i] : prl[l.size() - 1];
  }
  long long r;
  long long maximum = -1e17;
  long long pref = 0;
  long long sum;
  for (long long i = 0; i < s.size(); ++i) {
    pref += s[i];
    r = n - i;
    long long index = (r + d) / (d + 1);
    sum = pref;
    sum += (index - 1 >= 0 ? prl[index - 1] : 0);
    maximum = max(sum, maximum);
  }
  cout << maximum << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1;
  for (long long tt = 1; tt <= t; tt++) {
    solve();
  }
}
