#include <bits/stdc++.h>
using namespace std;
long long n, m, d, a[100005], sum[100005], ans, b[100005], res;
inline long long cmp(long long x, long long y) { return x > y; }
signed main() {
  cin >> n >> d >> m;
  for (long long i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (x > m)
      a[++a[0]] = x;
    else
      b[++b[0]] = x;
  }
  sort(a + 1, a + a[0] + 1, cmp);
  sort(b + 1, b + b[0] + 1, cmp);
  for (long long i = 1; i <= b[0]; i++) sum[i] = sum[i - 1] + b[i];
  for (long long i = 1; i <= a[0]; i++) {
    ans += a[i];
    long long k = (d + 1) * (i - 1) + 1;
    if (k > n) break;
    res = max(res, ans + sum[min(b[0], n - k)]);
  }
  printf("%lld", max(sum[b[0]], res));
}
