#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 4e18 + 10;
long long power(long long a, long long b, long long in_mod) {
  long long ans = 1;
  long long prod = a;
  while (b) {
    if (b % 2) ans = (ans * prod) % in_mod;
    prod = (prod * prod) % in_mod;
    b /= 2;
  }
  return ans;
}
long long mod_inv(long long q, long long in_mod) {
  return power(q, in_mod - 2, in_mod);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fact(long long n, long long in_mod) {
  long long f = 1;
  for (long long i = 1; i <= n; i++) f = (f * i) % in_mod;
  return f;
}
long long ncr(long long n, long long r, long long in_mod) {
  return (((fact(n, in_mod) * mod_inv(fact(r, in_mod), in_mod)) % in_mod) *
          mod_inv(fact(n - r, in_mod), in_mod)) %
         in_mod;
}
void solve() {
  long long n, d, m;
  cin >> n >> d >> m;
  long long a[n];
  long long cnt = 0;
  vector<long long> sm, lg;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    cnt += a[i];
    if (a[i] > m)
      lg.push_back(a[i]);
    else
      sm.push_back(a[i]);
  }
  if (lg.empty()) {
    cout << cnt << '\n';
    return;
  }
  sort((sm).begin(), (sm).end());
  reverse((sm).begin(), (sm).end());
  sort((lg).begin(), (lg).end());
  reverse((lg).begin(), (lg).end());
  for (long long i = 1; i < sm.size(); i++) sm[i] += sm[i - 1];
  for (long long i = 1; i < lg.size(); i++) lg[i] += lg[i - 1];
  long long mx = (n - 1) / (d + 1) + 1;
  mx = min(mx, (long long)lg.size());
  long long mn = (lg.size() - 1) / (d + 1) + 1;
  long long ans = 0;
  for (long long i = mn - 1; i < mx; i++) {
    long long req = i * d + (i + 1);
    if (lg.size() >= req)
      req = 0;
    else
      req -= lg.size();
    req = sm.size() - req;
    long long cur = lg[i];
    long long val = 0;
    if (req == 0) {
      val = cur;
    } else {
      val = cur + sm[req - 1];
    }
    ans = max(ans, val);
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(10);
  auto clk = clock();
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  long long t = 1;
  for (long long test = 1; test <= t; test++) {
    solve();
  }
  clk = clock() - clk;
  cerr << fixed << setprecision(6)
       << "Time: " << ((long double)clk) / CLOCKS_PER_SEC << "\n";
  return 0;
}
