#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, d, m, x;
  cin >> n >> d >> m;
  vector<long long int> big;
  vector<long long int> small;
  for (long long int i = 0; i < n; i++) {
    cin >> x;
    if (x > m)
      big.push_back(x);
    else
      small.push_back(x);
  }
  sort(big.begin(), big.end(), greater<long long int>());
  sort(small.begin(), small.end(), greater<long long int>());
  long long int s = (long long int)small.size();
  vector<long long int> prefix(s);
  if (s) prefix[0] = small[0];
  for (long long int i = 1; i < s; i++) prefix[i] = prefix[i - 1] + small[i];
  long long int rem, gmax, lmax, lbig;
  lbig = lmax = 0;
  if (s)
    gmax = prefix[s - 1];
  else
    gmax = 0;
  for (long long int i = 0; i < big.size(); i++) {
    if ((i * (d + 1) + 1) > n) break;
    lbig = lbig + big[i];
    rem = n - (i * (d + 1) + 1);
    rem = min(rem, s);
    lmax = lbig;
    if (rem) lmax += prefix[rem - 1];
    gmax = max(lmax, gmax);
  }
  cout << gmax << endl;
}
