#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 15;
long long a[N], sum1[N], c[N], b[N], sum2[N];
bool cmp(long long a, long long b) { return a > b; }
int main() {
  long long n, m, d, cnt1 = 0, cnt2 = 0, maxn = 0, x, ow = 0, k, op, od, tp;
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    ow += x;
    if (x <= m)
      a[++cnt1] = x;
    else
      b[++cnt2] = x;
  }
  if (cnt2 == 0) {
    cout << ow << endl;
    return 0;
  }
  sort(a + 1, a + 1 + cnt1);
  sort(b + 1, b + 1 + cnt2);
  tp = b[cnt2];
  cnt2--;
  sort(b + 1, b + 1 + cnt2, cmp);
  for (int i = 1; i <= cnt1; i++) sum1[i] = sum1[i - 1] + a[i];
  for (int i = 1; i <= cnt2; i++) sum2[i] = sum2[i - 1] + b[i];
  long long ok = cnt2 / (d + 1);
  maxn = sum2[ok] + sum1[cnt1] + tp;
  for (int i = ok + 1; i <= cnt2; i++) {
    k = i * (d + 1);
    od = k - cnt2;
    if (od > cnt1) break;
    op = sum2[i] + sum1[cnt1] - sum1[od];
    maxn = max(maxn, tp + op);
  }
  cout << maxn << endl;
  return 0;
}
