#include <bits/stdc++.h>
using namespace std;
long long lr[100004], sm[100004];
void solve() {
  long long n, d, m, x, l = 0, s = 0;
  cin >> n >> d >> m;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x > m) {
      lr[l++] = x;
    } else {
      sm[s++] = x;
    }
  }
  if (l == 0) {
    for (int i = 0; i < n; i++) {
      l += sm[i];
    }
    cout << l << "\n";
    return;
  }
  sort(lr, lr + l);
  reverse(lr, lr + l);
  sort(sm, sm + s);
  reverse(sm, sm + s);
  for (int i = 1; i < l; i++) {
    lr[i] = lr[i] + lr[i - 1];
  }
  for (int i = 1; i < s; i++) {
    sm[i] = sm[i] + sm[i - 1];
  }
  long long mx = 0;
  for (int i = 0; i < l; i++) {
    if (i * (d + 1) + 1 > n) {
      break;
    }
    long long ix = (n - (i * (d + 1) + 1));
    if (ix > s) {
      mx = max(mx, lr[i] + sm[s - 1]);
      continue;
    }
    if (ix == 0) {
      mx = max(mx, lr[i]);
      break;
    }
    long long v = lr[i] + sm[ix - 1];
    mx = max(mx, v);
  }
  cout << mx << "\n";
}
int main() {
  solve();
  return 0;
}
