#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
int read() {
  char c;
  while ((c = getchar()) < '-')
    ;
  if (c == '-') {
    int x = (c = getchar()) - '0';
    while ((c = getchar()) >= '0') x = x * 10 + c - '0';
    return -x;
  }
  int x = c - '0';
  while ((c = getchar()) >= '0') x = x * 10 + c - '0';
  return x;
}
const int N = 1e5 + 5;
int a1[N], a2[N];
int main() {
  int n, d, m;
  cin >> n >> d >> m;
  int n1 = 0, n2 = 0;
  for (int i = 1; i <= n; ++i) {
    int x = read();
    if (x <= m)
      a1[++n1] = x;
    else
      a2[++n2] = x;
  }
  sort(a1 + 1, a1 + n1 + 1);
  sort(a2 + 1, a2 + n2 + 1);
  int64_t sum = 0;
  int x = (n2 + d) / (d + 1);
  for (int i = n2 - x + 1; i <= n2; ++i) sum += a2[i];
  for (int i = 1; i <= n1; ++i) sum += a1[i];
  int64_t ans = sum;
  int y = 0;
  while (x < n2) {
    ++x;
    sum += a2[n2 - x + 1];
    int y1 = x * (d + 1) - d - n2;
    if (y1 > n1) break;
    while (y < y1) sum -= a1[++y];
    chmax(ans, sum);
  }
  cout << ans;
}
