#include <bits/stdc++.h>
using namespace std;
int cnt;
long long a[1000010], sum[1000010], ans;
int main() {
  long long n, d, m;
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (a[i] <= m) cnt++;
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + a[i];
  for (long long i = 0; i <= n - cnt; i++) {
    if (i * (d + 1) < n - cnt) continue;
    if ((i - 1) * (d + 1) + 1 > n) continue;
    long long temp = n - max((i - 1) * (d + 1) + 1, n - cnt);
    ans = max(ans, sum[n] - sum[n - i] + sum[cnt] - sum[cnt - temp]);
  }
  cout << ans << endl;
  return 0;
}
