#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MOD = 998244353;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while (!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) int idx,
               __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
int32_t main() {
  ios::sync_with_stdio(!cin.tie(NULL));
  int n, d, m;
  cin >> n >> d >> m;
  vector<long long> l, g;
  long long cur;
  for (int i = 0; i < n; i++) {
    cin >> cur;
    if (cur > m)
      g.push_back(cur);
    else
      l.push_back(cur);
  }
  sort(l.begin(), l.end(), greater<long long>());
  sort(g.begin(), g.end(), greater<long long>());
  for (int i = 1; i < (int)l.size(); i++) l[i] += l[i - 1];
  for (int i = 1; i < (int)g.size(); i++) g[i] += g[i - 1];
  long long ans = 0;
  if ((int)l.size()) ans = l.back();
  for (long long i = 0; i < (long long)g.size(); i++) {
    long long rem = (long long)n - ((long long)i * d) - i - 1;
    42;
    if (rem > 0 and !l.empty())
      ans = max(ans, g[i] + l[min((long long)l.size() - 1, rem - 1)]);
    else if (rem >= 0)
      ans = max(ans, g[i]);
    42;
  }
  cout << ans;
}
