#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long a[N], b[N], c[N];
int cmp(int a, int b) { return a > b; }
int main() {
  int n, d, m;
  cin >> n >> d >> m;
  int toa = 1, tob = 1;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (x <= m)
      a[toa++] = x;
    else
      b[tob++] = x;
  }
  sort(a + 1, a + toa, cmp);
  sort(b + 1, b + tob, cmp);
  for (int i = 1; i <= n; i++) c[i] = c[i - 1] + a[i];
  long long sum = 0, ans = c[n];
  for (int j = 1; j < tob; j++) {
    sum += b[j];
    int y = (j - 1) * (d + 1) + 1;
    if (y > n) break;
    y = n - y;
    ans = max(ans, sum + c[y]);
  }
  cout << ans << endl;
  return 0;
}
