#include <bits/stdc++.h>
using namespace std;
long long pref_l[100005], pref_u[100005];
int32_t main() {
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> les;
  vector<long long> up;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a > m) {
      up.push_back(a);
    } else {
      les.push_back(a);
    }
  }
  long long n1 = up.size(), n2 = les.size();
  sort(up.begin(), up.end());
  reverse(up.begin(), up.end());
  sort(les.begin(), les.end());
  reverse(les.begin(), les.end());
  for (long long i = 0; i < n2; i++) {
    pref_l[i] = (i != 0 ? pref_l[i - 1] : 0) + les[i];
  }
  for (long long i = 0; i < n1; i++) {
    pref_u[i] = (i != 0 ? pref_u[i - 1] : 0) + up[i];
  }
  long long ans = 0;
  for (long long i = 0; i <= n1; i++) {
    long long curr_ans = 0;
    if (i != 0) {
      curr_ans = pref_u[i - 1];
    }
    long long el_l = min(n2, n - (i - 1) * d - i);
    if (el_l < 0) {
      break;
    }
    if (el_l != 0) {
      curr_ans += pref_l[el_l - 1];
    }
    ans = max(ans, curr_ans);
  }
  cout << ans;
  return 0;
}
