#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
ll mod = 1e9 + 7;
template <typename T, typename U>
T binpow(T a, U n) {
  if (n == 0) return 1;
  if (n % 2 == 1)
    return (binpow(a, n - 1) * a) % mod;
  else {
    ll b = binpow(a, n / 2) % mod;
    return (b * b) % mod;
  }
}
template <typename T>
T gcd(T a, T b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
template <typename T>
istream& operator>>(istream& str, vector<T>& vec) {
  for (auto& w : vec) str >> w;
  return str;
}
template <typename T>
ostream& operator<<(ostream& str, vector<T>& vec) {
  for (auto& w : vec) str << w << ' ';
  return str;
}
ll n, d;
vector<ll> ff, ss;
ll f(ll param) {
  ll i = 0, k = 0;
  ll ans = 0;
  for (ll j = n - 1; j >= 0;) {
    if (i < param && i < ff.size()) {
      ans += ff[i];
      ++i;
      if (i != param - 1)
        j -= d + 1;
      else
        j--;
    } else {
      if (k < ss.size()) {
        ans += ss[k];
        ++k;
        j--;
      } else {
        break;
      }
    }
  }
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ll t;
  ll m;
  cin >> n >> d >> m;
  vector<ll> vec(n);
  cin >> vec;
  sort(vec.rbegin(), vec.rend());
  for (auto w : vec) {
    if (w > m) {
      ff.push_back(w);
    } else {
      ss.push_back(w);
    }
  }
  vector<ll> fsum(ff.size() + 1), ssum(ss.size() + 1);
  for (int i = 1; i < fsum.size(); ++i) {
    fsum[i] = fsum[i - 1] + ff[i - 1];
  }
  for (int i = 1; i < ssum.size(); ++i) {
    ssum[i] = ssum[i - 1] + ss[i - 1];
  }
  ll sum = 0;
  for (int i = 0; i < fsum.size(); ++i) {
    ll ost = n - (i - 1) * (d + 1) - 1;
    if (ost < 0) continue;
    sum = max(ssum[min((ll)ssum.size() - 1, ost)] + fsum[i], sum);
  }
  cout << sum;
}
