#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, d, m;
  cin >> n >> d >> m;
  vector<long long int> gre, low;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    if (x > m)
      gre.push_back(x);
    else
      low.push_back(x);
  }
  sort(gre.rbegin(), gre.rend());
  sort(low.rbegin(), low.rend());
  long long int l1 = gre.size(), l2 = low.size();
  for (long long int i = 1; i < l1; i++) gre[i] += gre[i - 1];
  for (long long int i = 1; i < l2; i++) low[i] += low[i - 1];
  long long int ans = 0;
  if (l2 >= 1) ans = low[l2 - 1];
  for (long long int i = 1; i <= l1; i++) {
    long long int need = (i - 1) * (d + 1) + 1;
    if (need <= n) {
      long long int temp = gre[i - 1];
      long long int x = min(l2 - 1, n - need - 1);
      if (x >= 0) temp += (low[x]);
      ans = max(ans, temp);
    }
  }
  cout << ans << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int q;
  q = 1;
  while (q--) solve();
  return 0;
}
