#include <bits/stdc++.h>
using namespace std;
const int NMAX = 200002;
long long f[NMAX], sp[NMAX];
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, d, m;
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) cin >> f[i];
  sort(f + 1, f + n + 1);
  long long pass = 0;
  for (int i = 1; i <= n; i++) {
    if (f[i] <= m) pass = i;
    sp[i] = sp[i - 1] + f[i];
  }
  long long ans = 0;
  for (int i = 0; i <= pass; i++) {
    long long days;
    long long funny = sp[pass] - sp[pass - i];
    days = n - i;
    long long cat = days / (d + 1);
    if (days % (d + 1) != 0) cat++;
    funny += sp[n] - sp[max(n - cat, pass)];
    ans = max(ans, funny);
  }
  cout << ans;
  return 0;
}
