#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, m;
  cin >> n >> d >> m;
  vector<long long int> a, b;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x > m)
      b.push_back(x);
    else
      a.push_back(x);
  }
  sort(a.begin(), a.end(), greater<long long int>());
  sort(b.begin(), b.end(), greater<long long int>());
  for (int i = 1; i < a.size(); i++) a[i] += a[i - 1];
  for (int i = 1; i < b.size(); i++) b[i] += b[i - 1];
  if (b.size() == 0)
    cout << a[n - 1] << endl;
  else if (a.size() == 0)
    cout << b[(n / (d + 1)) + (n % (d + 1) > 0 ? 1 : 0) - 1] << endl;
  else {
    long long int maxi = 0;
    for (int i = 0; i < b.size(); i++) {
      long long int rem = n - (i) * (d + 1) * 1LL - 1;
      if (rem < 0) break;
      long long int curr_val = b[i];
      if (rem - 1 < a.size() && rem > 0)
        curr_val += a[rem - 1];
      else if (rem - 1 > a.size() && rem > 0)
        curr_val += a[a.size() - 1];
      else if (rem == 0)
        curr_val += 0;
      maxi = max(maxi, curr_val);
    }
    cout << maxi << endl;
  }
}
