#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 2;
const int inf = 2e9;
const long long linf = 4e18;
long long pa[maxn], push_back[maxn];
void solve() {
  int n, d, m;
  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.rbegin(), a.rend());
  sort(b.rbegin(), b.rend());
  memset(pa, 0, sizeof(pa));
  memset(push_back, 0, sizeof(push_back));
  for (int i = 1; i <= a.size(); i++) pa[i] = pa[i - 1] + a[i - 1];
  for (int i = 1; i <= b.size(); i++)
    push_back[i] = push_back[i - 1] + b[i - 1];
  for (int i = b.size() + 1; i <= n; i++) push_back[i] = push_back[i - 1];
  long long ans = push_back[n];
  for (int i = 1; i <= a.size(); i++) {
    if ((i - 1) * (d + 1) + 1 > n) break;
    ans = max(ans, pa[i] + push_back[n - 1LL * (i - 1) * (d + 1) - 1]);
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  int tt = 1;
  while (tt--) solve();
  return 0;
}
