#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 105;
long long a[N], b[N], prea[N], preb[N];
void solve() {
  int d, n, t1 = 0, t2 = 0;
  long long m, ans = 0;
  cin >> n >> d >> m;
  for (int i = 1; i <= n; ++i) {
    long long x;
    cin >> x;
    if (x > m)
      a[++t1] = x;
    else
      b[++t2] = x, ans += x;
  }
  sort(a + 1, a + 1 + t1, greater<long long>());
  sort(b + 1, b + 1 + t2, greater<long long>());
  for (int i = 1; i <= t1; ++i) prea[i] = prea[i - 1] + a[i];
  for (int i = 1; i <= t2; ++i) preb[i] = preb[i - 1] + b[i];
  for (int i = t2 + 1; i <= n; ++i) preb[i] = preb[i - 1];
  for (int i = 1; i <= t1; ++i) {
    if (1 + 1ll * (i - 1) * (d + 1) > n) break;
    long long k = n - (1 + (i - 1) * (d + 1));
    ans = max(ans, prea[i] + preb[k]);
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int _ = 1;
  for (int i = 1; i <= _; ++i) solve();
}
