#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, d, m;
  cin >> n >> d >> m;
  vector<long long> a(n), big, small;
  for (long long& x : a) {
    cin >> x;
    if (x > m) {
      big.push_back(x);
    } else {
      small.push_back(x);
    }
  }
  sort(big.rbegin(), big.rend());
  sort(small.rbegin(), small.rend());
  vector<long long> prefix((int)small.size() + 1);
  for (int i = 0; i < (int)small.size(); i++) {
    prefix[i + 1] = prefix[i] + small[i];
  }
  long long ans = prefix.back();
  long long cur = 0;
  for (int i = 0; i < (int)big.size(); i++) {
    cur += big[i];
    int days = n - (i * (d + 1) + 1);
    if (days < 0) {
      break;
    }
    ans = max(ans, cur + prefix[min(days, (int)small.size())]);
  }
  cout << ans << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  srand(chrono::steady_clock::now().time_since_epoch().count());
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
