#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, d, mood;
  cin >> n >> d >> mood;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end(), greater<long long>());
  vector<long long> big, small;
  for (long long i = 0; i < n; i++)
    if (a[i] > mood)
      big.push_back(a[i]);
    else
      small.push_back(a[i]);
  long long ans = accumulate(small.begin(), small.end(), 0ll);
  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 limit = min((n - 1) / (d + 1) + 1, (long long)big.size());
  for (long long pen = 1; pen <= limit; pen++) {
    long long to_del = d * (pen - 1) - (big.size() - pen);
    if (to_del < 0) to_del = 0;
    long long tmp = big[pen - 1];
    long long small_index = (long long)(small.size()) - 1 - to_del;
    if (small_index >= 0) tmp += small[small_index];
    ans = max(ans, tmp);
  }
  cout << ans;
}
