#include <bits/stdc++.h>
using namespace std;
const long long MOD = (1 ? 100000000000000007 : 233333333333333333);
const int mod = (1 ? 1000000007 : 998244353);
inline long long mul(long long a, long long b) {
  long long s = 0;
  while (b) {
    if (b & 1) s = (s + a) % mod;
    a = (a << 1) % mod;
    b >>= 1;
  }
  return s % mod;
}
inline long long pow_mul(long long a, long long b) {
  long long s = 1;
  while (b) {
    if (b & 1) s = mul(s, a);
    a = mul(a, a);
    b >>= 1;
  }
  return s;
}
inline long long poww(long long a, long long b) {
  long long s = 1;
  while (b) {
    if (b & 1) s = (s * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return s % mod;
}
inline int read() {
  char c = getchar();
  int sgn = 1, ret = 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') sgn = -1, c = getchar();
  while (c >= '0' && c <= '9') ret = ret * 10 + c - 48, c = getchar();
  return ret * sgn;
}
void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
inline long long phi(long long x) {
  long long ans = x;
  for (long long i = 2; i * i <= x; i++)
    if (x % i == 0) {
      ans -= ans / i;
      while (x % i == 0) x /= i;
    }
  if (x > 1) ans -= ans / x;
  return ans;
}
long long inv(long long down) {
  return down == 1 ? 1 : ((mod - mod / down) * inv(mod % down)) % mod;
}
int st[4][2] = {-1, 0, 0, -1, 0, 1, 1, 0};
const long long INF = 1e18;
const int inf = 1e9;
const double eps = 1e-8;
const int N = 1e5 + 5;
int T, cas;
long long n, m;
long long a[N], sum[N];
bool cmp(long long x, long long y) { return x > y; }
void solve() {
  long long d;
  scanf("%lld%lld%lld", &n, &d, &m);
  long long ans = 0, tmp = 0;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (a[i] <= m)
      tmp += a[i];
    else
      cnt++;
  }
  if (cnt == 0) {
    printf("%lld\n", tmp);
    return;
  }
  sort(a + 1, a + 1 + n, cmp);
  sum[n + 1] = 0ll;
  for (int i = n; i >= 1; i--) sum[i] = sum[i + 1] + a[i];
  int l = 1;
  int r = min(1ll * cnt, (n + d) / (d + 1));
  for (int i = l; i <= r; i++) {
    int mid = i;
    ans =
        max(ans,
            sum[1] - sum[mid + 1] + sum[cnt + 1] -
                sum[min(n + 1, (n + 1 - (1ll * (mid - 1) * d - (cnt - mid))))]);
  }
  printf("%lld\n", ans);
}
int main() {
  n = m = 0, cas = T = 1;
  while (T--) {
    solve();
  }
}
