#include <bits/stdc++.h>
using namespace std;
int n, d, m;
vector<long long> s, bg;
long long ans, a[100005], b[100005];
int main() {
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x <= m)
      s.push_back(x);
    else
      bg.push_back(x);
  }
  int ss = s.size(), sb = bg.size();
  sort(s.begin(), s.end());
  sort(bg.begin(), bg.end());
  for (int i = 1; i <= ss; i++) a[i] = s[i - 1] + a[i - 1];
  for (int i = 1; i <= sb; i++) b[i] = bg[i - 1] + b[i - 1];
  for (int i = 0; i <= ss; i++) {
    ans = max(ans, a[ss] - a[ss - i] + b[sb] -
                       b[max(0, sb - (n - i - 1) / (d + 1) - 1)]);
  }
  cout << ans;
}
