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