#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int M = 1e9 + 7;
const long double PI = acos(-1);
long long n, d, m;
long long a[N];
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long i, t;
  cin >> n >> d >> m;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long p = 0;
  for (i = 1; i <= n; i++) {
    if (a[i] > m && !p) p = i;
    a[i] += a[i - 1];
  }
  if (!p) {
    cout << a[n];
    return 0;
  }
  long long ans = 0;
  for (i = n; i >= p; i--) {
    long long x = n - i + 1;
    long long muzzled = (x - 1) * (d + 1) + 1;
    if (n - muzzled < p && n - muzzled >= 0)
      ans = max(ans, a[n] - a[i - 1] + a[p - 1] - a[p - 1 - n + muzzled]);
    else if (n - muzzled >= p && n - muzzled >= 0)
      ans = max(ans, a[n] - a[i - 1] + a[p - 1]);
  }
  cout << ans;
  return 0;
}
