#include <bits/stdc++.h>
using namespace std;
void solve() {
  const long long maxn = 1e6;
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> hi(maxn), lo(maxn);
  long long locnt = 0, hicnt = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    sum += a;
    if (a > m)
      hi[++hicnt] = a;
    else
      lo[++locnt] = a;
  }
  if (hicnt == 0) {
    cout << sum << "\n";
    return;
  }
  sort(hi.begin() + 1, hi.begin() + hicnt + 1);
  sort(lo.begin() + 1, lo.begin() + locnt + 1);
  reverse(hi.begin() + 1, hi.begin() + hicnt + 1);
  reverse(lo.begin() + 1, lo.begin() + locnt + 1);
  for (int i = 1; i <= hicnt; i++) hi[i] += hi[i - 1];
  for (int i = 1; i <= locnt; i++) lo[i] += lo[i - 1];
  for (int i = locnt + 1; i <= n; i++) lo[i] = lo[locnt];
  long long ans = 0;
  for (long long i = (hicnt + d) / (d + 1); i <= hicnt; i++) {
    if ((i - 1) * (d + 1) + 1 <= n) {
      ans = max(ans, hi[i] + lo[n - (i - 1) * (d + 1) - 1]);
    }
  }
  cout << ans << "\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
