#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, d, idx = 0, ans = 0;
  cin >> n >> d >> m;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] > m) idx++;
  }
  sort(a + 1, a + n + 1, greater<long long>());
  for (long long i = 2; i <= n; i++) a[i] += a[i - 1];
  if (idx == 0) {
    cout << a[n] << endl;
    return 0;
  }
  for (long long i = 1; i <= idx; i++) {
    long long days = n - (i - 1) * (d + 1) - 1;
    if (days >= 0) {
      long long x = a[i] + a[min(idx + days, n)] - a[idx];
      ans = max(ans, x);
    }
  }
  cout << ans << endl;
  return 0;
}
