#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
A cvt(B x) {
  stringstream ss;
  ss << x;
  A y;
  ss >> y;
  return y;
}
int n, d, m;
int a[100000];
int main() {
  scanf("%d %d %d", &n, &d, &m);
  vector<int> big, small;
  long long sb = 0, ss = 0;
  for (int i = 0; i < (int)(n); i++) {
    scanf("%d", &a[i]);
    if (a[i] <= m) {
      small.push_back(a[i]);
      ss += a[i];
    } else
      big.push_back(a[i]);
  }
  sort((big).begin(), (big).end());
  reverse((big).begin(), (big).end());
  for (int i = 0; i < (int)(d); i++) small.push_back(0);
  sort((small).begin(), (small).end());
  int j = 0;
  long long ans = 0;
  for (int i = (0); i <= ((int)big.size()); i++) {
    if (i >= 1) sb += big[i - 1];
    long long rem = (int)big.size() - i;
    long long todo = max(0LL, i * d - rem);
    if (todo > small.size()) break;
    while (j < todo) {
      ss -= small[j];
      j++;
    }
    ans = max(ans, sb + ss);
  }
  cout << ans << endl;
  return 0;
}
