#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> arr(n), big, small;
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > m)
      big.push_back(arr[i]);
    else
      small.push_back(arr[i]);
  }
  sort(big.begin(), big.end());
  reverse(big.begin(), big.end());
  sort(small.begin(), small.end());
  reverse(small.begin(), small.end());
  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 l = 0, u = big.size();
  long long ans = 0;
  long long k = (big.size()) / (d + 1);
  if ((big.size()) % (d + 1)) k++;
  if (k == 0)
    ans = small[small.size() - 1], cout << ans << endl;
  else {
    for (long long mid = k; mid <= big.size(); mid++) {
      long long x = mid;
      long long left = 0;
      if (x != 0) left = (x - 1) * (d + 1) + 1;
      long long sm = n - left;
      sm = min((long long)(small.size()), sm);
      long long cost = 0;
      if (n - left >= 0) {
        if (sm > 0) cost += small[sm - 1];
        if (x > 0) cost += big[x - 1];
        ans = max(cost, ans);
      }
    }
    cout << ans << endl;
  }
}
