#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void solve() {
  int n, m, d;
  cin >> n >> d >> m;
  vector<long long> a, b;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x > m)
      a.push_back(x);
    else
      b.push_back(x);
  }
  sort(a.begin(), a.end(), greater<long long>());
  sort(b.begin(), b.end(), greater<long long>());
  int s1 = a.size() - 1, s2 = b.size() - 1;
  for (int i = 0; i < s1; i++) {
    a[i + 1] += a[i];
  }
  for (int i = 0; i < s2; i++) {
    b[i + 1] += b[i];
  }
  long long ans = 0;
  int x = min(n, int(b.size())) - 1;
  if (x >= 0) ans += b[x];
  for (int i = 1; i <= a.size(); i++) {
    long long big = 1ll * (i - 1) * (d + 1) + 1;
    if (big > 1ll * n) break;
    long long small = max(0ll, min(n - big, (long long)b.size())) - 1;
    long long curr = a[i - 1];
    if (small >= 0) curr += b[small];
    ans = max(ans, curr);
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
