#include <bits/stdc++.h>
using namespace std;
const int mxN = 5 * 1e5 + 10;
const int mod = 1e9 + 7;
long long a[mxN];
vector<long long> more;
vector<long long> les;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, d;
  long long m;
  long long temp;
  cin >> n >> d >> m;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    sum += temp;
    if (temp > m)
      more.push_back(temp);
    else
      les.push_back(temp);
  }
  if (more.empty()) {
    cout << sum;
    return 0;
  }
  sort(more.begin(), more.end());
  sort(les.begin(), les.end());
  int ovihVecihStaje = min((n - 1) / (d + 1) + 1, (int)more.size());
  int manjih = (n - 1) - (ovihVecihStaje - 1) * (d + 1);
  while (1) {
    long long sum = 0;
    for (int i = les.size() - manjih - 1;
         i >= max((int)les.size() - manjih - 1 - d, 0); i--) {
      sum += les[i];
    }
    if (sum > more[more.size() - ovihVecihStaje]) {
      manjih += d + 1;
      ovihVecihStaje--;
    } else {
      break;
    }
  }
  long long ans = 0;
  for (int i = max((int)les.size() - manjih, 0); i < les.size(); i++) {
    ans += les[i];
  }
  for (int i = more.size() - ovihVecihStaje; i < more.size(); i++) {
    ans += more[i];
  }
  cout << ans;
}
