#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 1, mod = 1e9 + 7;
long long solve() {
  long long n;
  cin >> n;
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, d, m;
  cin >> n >> d >> m;
  vector<long long> a, b;
  for (long long i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    if (x > m)
      b.push_back(x);
    else
      a.push_back(x);
  }
  sort(a.rbegin(), a.rend());
  sort(b.rbegin(), b.rend());
  vector<long long> prs(b.size() + 1, 0);
  for (long long i = 1; i <= b.size(); ++i) prs[i] = prs[i - 1] + b[i - 1];
  long long ans = 0, val = 0;
  for (long long i = 0; i <= a.size(); ++i) {
    if (i) val += a[i - 1];
    long long ost = n - i, nwa = 0;
    if (ost < 0) break;
    long long nw = ost / (d + 1);
    if (ost % (d + 1)) ++nw;
    nwa = prs[min(nw, (long long)prs.size() - 1)];
    ans = max(ans, nwa + val);
  }
  cout << ans;
}
