#include <bits/stdc++.h>
using namespace std;
void debug_arr(vector<long long> &a) {
  long long len = a.size();
  for (long long i = 0; i < len; ++i) {
    cout << a[i] << " ";
  }
  cout << endl;
}
const long long mod = 1e9 + 7;
const long long mod1 = 998244353;
void solve() {
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> a(n);
  vector<long long> small, big;
  long long x;
  for (long long i = 0; i < n; ++i) {
    cin >> x;
    if (x > m)
      big.push_back(x);
    else
      small.push_back(x);
  }
  sort(big.begin(), big.end(), greater<long long>());
  sort(small.begin(), small.end(), greater<long long>());
  for (long long i = 1; i < big.size(); ++i) big[i] += big[i - 1];
  for (long long i = 1; i < small.size(); ++i) small[i] += small[i - 1];
  long long ans = INT_MIN;
  if (big.size() == 0) ans = small[n - 1];
  for (long long b = 1; b <= big.size(); ++b) {
    long long b_days = (b - 1) * (d + 1) + 1;
    long long tmp_ans;
    if (b_days > n)
      break;
    else if (b_days == n)
      tmp_ans = big[b - 1];
    else {
      tmp_ans = big[b - 1];
      long long s_days = n - b_days;
      if (s_days <= small.size())
        tmp_ans += small[s_days - 1];
      else if (small.size() > 0)
        tmp_ans += small[small.size() - 1];
    }
    ans = max(ans, tmp_ans);
  }
  cout << ans << endl;
  return;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  { solve(); }
  return 0;
}
