#include <bits/stdc++.h>
using namespace std;
int n, d, m, a[100001], id;
long long sum[100001];
int main() {
  scanf("%d%d%d", &n, &d, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  sort(a + 1, a + 1 + n);
  id = upper_bound(a + 1, a + 1 + n, m) - a;
  for (int i = 1; i <= n; ++i) sum[i] = sum[i - 1] + a[i];
  if (id == n + 1) {
    printf("%lld\n", sum[n]);
    return 0;
  }
  long long ans = 0;
  for (int i = 0; i <= n - id; ++i) {
    if ((d + 1) * i > n - 1) break;
    int k = min(n - 1 - (d + 1) * i, id - 1);
    ans = max(ans, sum[id - 1] - sum[id - 1 - k] + sum[n - 1] - sum[n - 1 - i]);
  }
  ans += a[n];
  printf("%lld\n", ans);
  return 0;
}
