#include <bits/stdc++.h>
using namespace std;
template <class T>
T modulo(T x, T p) {
  if (x >= 0) return x % p;
  return p + x % p;
}
template <class T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, d;
  long long m;
  cin >> n >> d >> m;
  vector<long long> b(1, 0), s(1, 0);
  long long a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a > m)
      b.push_back(a);
    else
      s.push_back(a);
  }
  int nb = b.size() - 1, ns = s.size() - 1;
  sort(b.begin() + 1, b.end(), greater<long long>());
  sort(s.begin() + 1, s.end(), greater<long long>());
  for (int i = 1; i <= nb; i++) b[i] += b[i - 1];
  for (int i = 1; i <= ns; i++) s[i] += s[i - 1];
  if (nb == 0) {
    cout << s[ns];
    return 0;
  }
  long long ans = 0;
  for (int big = (nb + d) / (d + 1); big <= nb; big++) {
    long long small = n - (1ll * (big - 1) * (d + 1) + 1);
    if (small >= 0 && small <= n)
      ans = max(ans, b[big] + s[min(small, 1ll * ns)]);
  }
  cout << ans;
  return 0;
}
