#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long min(long long a, long long b) { return (a < b) ? a : b; }
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long fp(long long a, long long b) {
  if (b == 0) return 1;
  long long x = fp(a, b / 2);
  x = (x * x) % mod;
  if (b & 1) x = (x * a) % mod;
  return x;
}
const long long N = 1e5 + 5;
long long sm1[N] = {0}, sm[N] = {0};
void solve() {
  long long n, d, m, x;
  cin >> n >> d >> m;
  vector<long long> a, b;
  for (long long i = 1; i <= n; i++) {
    cin >> x;
    if (x > m)
      b.push_back(x);
    else
      a.push_back(x);
  }
  sort(a.rbegin(), a.rend());
  sort(b.rbegin(), b.rend());
  sm1[0] = 0;
  for (long long i = 1; i <= a.size(); i++) {
    sm1[i] = sm1[i - 1] + a[i - 1];
  }
  sm[0] = 0;
  for (long long i = 1; i <= b.size(); i++) {
    sm[i] = sm[i - 1] + b[i - 1];
  }
  long long l = 0, r = b.size();
  long long ans = 0;
  for (long long l = 0; l <= min(b.size(), 1 + (n - 1) / (d + 1)); l++) {
    long long z;
    if (l > 1) {
      z = min(a.size(), n - ((l - 1) * (d + 1) + 1));
    } else {
      z = a.size();
    }
    ans = max(ans, sm[l] + sm1[z]);
  }
  cout << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(time(0));
  long long t;
  t = 1;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
}
