#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N], s[N], f[N];
int n, d, m;
int main() {
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  int ff = 0, x = n + 1;
  for (int i = 1; i <= n; i++) {
    if (m < a[i]) {
      ff = 1;
      x = i;
      reverse(a + 1, a + x);
      if (ff == 1) break;
    }
  }
  for (int i = 1; i <= n; i++) s[i] += s[i - 1] + a[i];
  for (int i = n; i >= 1; i--) f[i] += f[i + 1] + a[i];
  long long maxn = 0;
  int i = n;
  for (int t = 1; t <= n;) {
    int minn = min(n - t, x - 1);
    maxn = max(maxn, f[i] + s[minn]);
    i--;
    t = t + d + 1;
  }
  cout << maxn << endl;
}
