#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, d, m;
  long long int i, j, k;
  cin >> n >> d >> m;
  vector<long long int> big, small;
  for (i = 0; i < n; i++) {
    cin >> j;
    if (j > m)
      big.push_back(j);
    else
      small.push_back(j);
  }
  sort(big.begin(), big.end(), greater<long long int>());
  sort(small.begin(), small.end(), greater<long long int>());
  long long int maxs = 0;
  for (i = 1; i < big.size(); i++) big[i] += big[i - 1];
  for (i = 1; i < small.size(); i++) small[i] += small[i - 1];
  for (i = 0; i <= big.size(); i++) {
    long long int ans = 0;
    long long int cntb = i;
    long long int cnts;
    cnts = max(0ll, (cntb - 1) * d);
    cnts = max(0ll, cnts - (long long int)big.size() + cntb);
    if (big.size() + cnts > n) break;
    long long int take = (long long int)small.size() - cnts - 1ll;
    if (cntb != 0ll) ans = big[cntb - 1ll];
    if (take >= 0ll) ans += small[take];
    maxs = max(maxs, ans);
  }
  cout << maxs << endl;
}
