#include <bits/stdc++.h>
using namespace std;
int n, d, m, big[100010];
long long small[100010];
int main() {
  scanf("%d%d%d", &n, &d, &m);
  for (register int i = 1, x; i <= n; ++i) {
    scanf("%d", &x);
    if (x <= m) {
      small[++small[0]] = x;
    } else {
      big[++big[0]] = x;
    }
  }
  sort(small + 1, small + small[0] + 1, greater<int>());
  for (register int i = 2; i <= n; ++i) {
    small[i] += small[i - 1];
  }
  sort(big + 1, big + big[0] + 1, greater<int>());
  register long long sum = 0, ans = small[n];
  small[0] = 0;
  for (register int i = 1; i <= big[0]; ++i) {
    register long long target = n - ((long long)i - 1) * (d + 1) - 1;
    if (target < 0) {
      break;
    }
    sum += big[i];
    ans = max(ans, sum + small[target]);
  }
  printf("%lld\n", ans);
  return 0;
}
