#include <bits/stdc++.h>
using namespace std;
long long int bin(long long int a, long long int b) {
  if (b == 0) return 1;
  if (b & 1) return (a * bin((a * a) % 1000000007, b / 2)) % 1000000007;
  return (1 * bin((a * a) % 1000000007, b / 2)) % 1000000007;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, d, m;
  cin >> n >> d >> m;
  vector<long long int> b, s;
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    sum += x;
    if (x > m)
      b.push_back(x);
    else
      s.push_back(x);
  }
  sort(b.begin(), b.end());
  reverse(b.begin(), b.end());
  sort(s.begin(), s.end());
  reverse(s.begin(), s.end());
  for (int i = 1; i < b.size(); i++) {
    b[i] += b[i - 1];
  }
  for (int i = 1; i < s.size(); i++) {
    s[i] += s[i - 1];
  }
  if (b.size() == 0) {
    cout << sum << endl;
    return 0;
  }
  long long int ans = 0;
  for (long long int i = 0; i < b.size(); i++) {
    long long int val = b[i];
    long long int te = max(0LL, i * d);
    long long int te1 = b.size();
    te1 = max(0LL, (te1 - i - 1LL));
    long long int p = max(0LL, te - te1);
    long long int temp = s.size();
    if (temp - p > 0)
      val += s[s.size() - 1 - p];
    else if (s.size() - p == 0) {
      ans = max(ans, val);
    } else
      continue;
    ans = max(ans, val);
  }
  cout << ans << endl;
}
