#include <bits/stdc++.h>
template <typename T>
bool chmax(T &m, const T q) {
  if (m < q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T>
bool chmin(T &m, const T q) {
  if (m > q) {
    m = q;
    return true;
  } else
    return false;
}
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LNF = 0x3f3f3f3f3f3f;
inline int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline int lcm(int a, int b) { return a * b / gcd(a, b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n, d, m;
    cin >> n >> d >> m;
    vector<long long> big, small;
    int a[n];
    for (int i = int(0); i < int(n); ++i) {
      cin >> a[i];
      if (a[i] <= m)
        small.push_back(a[i]);
      else {
        big.push_back(a[i]);
      }
    }
    if (big.size() == 0) {
      long long temp = 0;
      for (int i = int(0); i < int(n); ++i) temp += small[i];
      cout << temp << '\n';
      exit(0);
    }
    int s = small.size(), l = big.size();
    for (int i = int(l); i < int(n + 1); ++i) {
      big.push_back(0);
    }
    for (int i = int(s); i < int(n + 1); ++i) {
      small.push_back(0);
    }
    sort(big.begin(), big.end(), greater<int>());
    sort(small.begin(), small.end(), greater<int>());
    for (int i = int(1); i < int(l + 1); ++i) big[i] += big[i - 1];
    for (int i = int(1); i < int(s + 1); ++i) small[i] += small[i - 1];
    for (int i = int(s); i < int(n + 1); ++i) {
      small[i] = small[s];
    }
    long long val;
    long long ans = 0;
    for (int i = int((l + d) / (1 + d)); i < int(l + 1); ++i) {
      long long nbig, nsmall;
      nbig = 1ll * (i - 1) * (d + 1) + 1;
      nsmall = 1ll * n - 1ll * nbig;
      if (nsmall >= 0 && nbig <= n) {
        if (nsmall >= 1)
          val = big[i - 1] + small[nsmall - 1];
        else {
          val = big[i - 1];
        }
        chmax(ans, val);
      }
    }
    cout << ans << '\n';
  }
  return 0;
}
