#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const long long inf = 0x3f3f3f3f3f3f3f3fll;
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n, d, m, i, ans = 0, sum = 0, rem;
  cin >> n >> d >> m;
  long long a[n];
  vector<long long> big, small;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > m)
      big.push_back(a[i]);
    else
      small.push_back(a[i]);
  }
  sort(small.begin(), small.end());
  reverse(small.begin(), small.end());
  sort(big.begin(), big.end());
  reverse(big.begin(), big.end());
  for (i = 1; i < big.size(); i++) big[i] += big[i - 1];
  for (i = 1; i < small.size(); i++) small[i] += small[i - 1];
  for (i = 0; i <= big.size(); i++) {
    if (i == 0) {
      sum = 0;
      rem = n;
    } else {
      sum = big[i - 1];
      rem = n - (i * d + i - d);
    }
    if (rem < 0) break;
    rem = ((rem) < (small.size()) ? (rem) : (small.size()));
    if (rem != 0) sum += small[rem - 1];
    ans = ((ans) > (sum) ? (ans) : (sum));
  }
  cout << ans;
  return 0;
}
