#include <bits/stdc++.h>
using namespace std;
int a[200005];
long long f[200005], s[200005];
int main() {
  int n, d, m;
  scanf("%d%d%d", &n, &d, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) s[i] = a[i] + s[i - 1];
  int x = 0, y;
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] <= m) x = i;
  y = n - x;
  for (int k = 0; k * (d + 1) - d <= n && k <= y; k++) {
    int t = d * (k - 1) - (y - k);
    if (t > x) break;
    t = max(t, 0);
    ans = max(ans, s[n] - s[n - k] + s[x] - s[t]);
  }
  cout << ans;
  return 0;
}
