#include <bits/stdc++.h>
using namespace std;
long long n, d, m, s1[100005], s2[100005], a[100005], dem = 0;
int main() {
  cin >> n >> d >> m;
  for (long long i = (1); i <= (n); ++i) {
    cin >> a[i];
    if (a[i] > m) dem++;
  }
  sort(a + 1, a + n + 1);
  long long id = upper_bound(a + 1, a + n + 1, m) - a;
  long long h = 0;
  for (long long i = (id - 1); i >= (1); --i) {
    h++;
    s1[h] = s1[h - 1] + a[i];
  }
  h = 0;
  for (long long i = (n); i >= (id); --i) {
    h++;
    s2[h] = s2[h - 1] + a[i];
  }
  long long ans = s1[n - dem];
  for (long long i = (1); i <= (dem); ++i) {
    long long tmp = (i - 1) * (d + 1);
    if (tmp > n - 1) continue;
    ans = max(ans, s1[min(n - 1 - tmp, n - dem)] + s2[i]);
  }
  cout << ans;
  return 0;
}
