#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long a[N];
long long b[N];
long long ans = 0;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, d, m;
  cin >> n >> d >> m;
  int n1 = 0, n2 = 1;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x > m) {
      a[n1++] = x;
    } else {
      b[n2++] = x;
    }
  }
  sort(a, a + n1, greater<long long>());
  sort(b + 1, b + n2, greater<long long>());
  for (int i = 1; i < n1; i++) {
    a[i] += a[i - 1];
  }
  for (int i = 1; i < n2; i++) {
    b[i] += b[i - 1];
  }
  for (int i = 0; i < n2; i++) {
    int rest = (n - i) / (d + 1);
    if ((n - i) % (d + 1)) rest++;
    rest = min(rest, n1);
    ans = max(ans, b[i] + a[rest - 1]);
  }
  cout << ans << endl;
  return 0;
}
