#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
long long a[N], b[N];
int posa = 0, posb = 0, cntb = 0;
int main() {
  ios::sync_with_stdio(0);
  int n, d, m;
  cin >> n >> d >> m;
  for (int i = 1; i <= n; ++i) {
    long long tmp;
    cin >> tmp;
    if (tmp > m) {
      a[++posa] = tmp;
    } else {
      b[++posb] = tmp;
    }
  }
  sort(a + 1, a + 1 + posa, greater<long long>());
  sort(b + 1, b + 1 + posb, greater<long long>());
  for (int i = 1; i <= n; ++i) {
    b[i] += b[i - 1];
  }
  long long sum = 0, ans = b[posb];
  for (int i = 1; i <= posa; ++i) {
    sum += a[i];
    long long sub = (long long)(i - 1) * (d + 1) + 1;
    if (sub > n) break;
    ans = max(ans, b[(long long)n - sub] + sum);
  }
  cout << ans;
}
