#include <bits/stdc++.h>
using namespace std;
vector<long long> v, w;
int main() {
  int i, n, d, m;
  cin >> n >> d >> m;
  for (i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a > m)
      v.push_back(a);
    else
      w.push_back(a);
  }
  sort(v.rbegin(), v.rend());
  sort(w.rbegin(), w.rend());
  long long ans = 0, ans1 = 0, ans2 = 0;
  for (i = 0; i < w.size(); i++) ans += w[i];
  ans1 = ans;
  int j = w.size();
  for (i = 0; i < v.size(); i++) {
    ans2 += v[i];
    if (i * (d + 1) + 1 > n) break;
    while (j > 0 && j + i * (d + 1) + 1 > n) {
      j--;
      ans1 -= w[j];
    }
    ans = max(ans, ans1 + ans2);
  }
  cout << ans << endl;
}
