#include <bits/stdc++.h>
using namespace std;
const int mac = 1e5 + 10;
vector<int> a, b;
long long sum[mac];
bool cmp(int x, int y) { return x > y; }
int main(int argc, char const *argv[]) {
  int n, d, m;
  scanf("%d%d%d", &n, &d, &m);
  d++;
  a.push_back(0);
  b.push_back(0);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x > m)
      a.push_back(x);
    else
      b.push_back(x);
  }
  sort(a.begin() + 1, a.end(), cmp);
  sort(b.begin() + 1, b.end(), cmp);
  for (int i = 1; i <= b.size(); i++) sum[i] = sum[i - 1] + b[i];
  long long day = n - 1 + d, tail = 1, head = 1;
  long long ok = b.size() - 1;
  long long ans = sum[ok];
  long long res = 0;
  while (day > 0 && head <= a.size() - 1) {
    res = res + a[head];
    head++;
    day = day - d;
    if (day < 0) {
      break;
    }
    ans = max(ans, res + sum[min(ok, day)]);
  }
  printf("%lld\n", ans);
  return 0;
}
