#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 55;
const int INF = 1e9 + 77;
const long long INFINF = 1e18 + 1e17;
const double PI = acos(-1.0);
long long Power(long long x, long long y) {
  if (!y) return 1;
  long long s = Power(x, y >> 1);
  s *= s;
  if (y & 1) s *= x;
  return s;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> small;
  vector<long long> big;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a > m) {
      big.push_back(a);
    } else {
      small.push_back(a);
    }
  }
  sort(small.begin(), small.end(), greater<long long>());
  sort(big.begin(), big.end(), greater<long long>());
  vector<long long> preSmall((int)small.size());
  vector<long long> preBig((int)big.size());
  if ((int)small.size()) {
    preSmall[0] = small[0];
    for (int i = 1; i < (int)small.size(); i++) {
      preSmall[i] = preSmall[i - 1] + small[i];
    }
  }
  if ((int)big.size()) {
    preBig[0] = big[0];
    for (int i = 1; i < (int)big.size(); i++) {
      preBig[i] = preBig[i - 1] + big[i];
    }
  }
  long long ans = 0;
  for (int how = 0; how <= (int)small.size(); how++) {
    long long rest = n - how;
    rest = (rest / (d + 1)) + ((bool)(rest % (d + 1)));
    long long curAns = 0;
    if (how) {
      curAns = preSmall[how - 1];
    }
    if (rest <= (int)big.size()) {
      if (rest) {
        curAns += preBig[rest - 1];
      }
      ans = max(ans, curAns);
    }
  }
  cout << ans;
  return 0;
}
