#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x >= 10) write(x / 10);
  putchar('0' + x % 10);
}
inline void writeln(long long x) {
  write(x);
  puts("");
}
inline void writep(long long x) {
  write(x);
  putchar(' ');
}
inline unsigned long long rnd() {
  return ((unsigned long long)rand() << 30 ^ rand()) << 4 | rand() % 4;
}
const int N = 1e5 + 5;
int a[N], b[N];
long long f[N], suma[N], sumb[N];
int main() {
  int k = read(), n = 0, m = 0, d = read(), M = read();
  for (int i = (int)(1); i <= (int)(k); i++) {
    int x = read();
    if (x <= M)
      a[++n] = x;
    else
      b[++m] = x;
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  reverse(a + 1, a + n + 1);
  for (int i = (int)(1); i <= (int)(n); i++) suma[i] = suma[i - 1] + a[i];
  long long ans = 0, sum = 0;
  for (int i = (int)(m); i >= (int)(1); i--) {
    sum += b[i];
    int cnt = ((m - i + 1) - 1) * (d + 1) + 1;
    if (cnt > k) break;
    ans = max(ans, sum + suma[min(k - cnt, n)]);
  }
  cout << max(suma[n], ans);
}
