#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  int n, d, m;
  cin >> n >> d >> m;
  vector<long long> less, more;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a <= m)
      less.push_back(a);
    else
      more.push_back(a);
  }
  sort(less.begin(), less.end(), greater<long long>());
  sort(more.begin(), more.end(), greater<long long>());
  for (int i = 1; i < less.size(); i++) less[i] += less[i - 1];
  for (int i = 1; i < more.size(); i++) more[i] += more[i - 1];
  long long ans = 0;
  if (more.size() == 0) {
    ans = less[less.size() - 1];
    cout << ans << endl;
    return 0;
  }
  if (n % (d + 1) == 0) {
    if (n / (d + 1) <= more.size()) ans = more[n / (d + 1) - 1];
  } else {
    if (n / (d + 1) + 1 <= more.size()) ans = more[n / (d + 1)];
  }
  for (int i = 0; i < less.size(); i++) {
    long long cur = less[i];
    int t = n - i - 1;
    if (t % (d + 1) == 0) {
      if (t / (d + 1) <= more.size()) cur += more[t / (d + 1) - 1];
    } else {
      if (t / (d + 1) + 1 <= more.size()) cur += more[t / (d + 1)];
    }
    ans = max(ans, cur);
  }
  cout << ans << endl;
}
