#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, m;
  cin >> n >> d >> m;
  vector<int> a(n);
  vector<int> A, B;
  for (auto &x : a) {
    scanf("%d", &x);
    if (x > m)
      A.push_back(x);
    else
      B.push_back(x);
  }
  sort(A.rbegin(), A.rend());
  sort(B.rbegin(), B.rend());
  vector<long long> pA(A.size() + 1);
  for (int i = 1; i <= A.size(); ++i) pA[i] = pA[i - 1] + A[i - 1];
  long long res = 0;
  long long s = 0;
  ++d;
  for (int i = 0; i <= B.size(); ++i) {
    if (i) s += B[i - 1];
    int rem = n - i;
    int can = (rem + d - 1) / d;
    if (can > A.size()) continue;
    res = max(res, s + pA[can]);
  }
  cout << res << endl;
  return 0;
}
