#include <bits/stdc++.h>
using namespace std;
long long a[100005], b[100005];
int main() {
  long long n, d, m, a1 = 0, b1 = 0, ans = 0;
  cin >> n >> d >> m;
  for (long long i = 0; i < n; i++) {
    long long c;
    cin >> c;
    if (c > m) {
      a1++;
      a[a1] = c;
    } else {
      b1++;
      b[b1] = c;
    }
  }
  sort(a + 1, a + a1 + 1);
  reverse(a + 1, a + a1 + 1);
  for (long long i = 1; i <= a1; i++) a[i] += a[i - 1];
  sort(b + 1, b + b1 + 1);
  reverse(b + 1, b + b1 + 1);
  for (long long i = 1; i <= b1; i++) b[i] += b[i - 1];
  for (long long x = 0; x <= a1; x++) {
    long long a2 = max((x - 1) * (d + 1) + 1, 0LL);
    long long b2 = n - a2;
    if (b2 < 0) break;
    b2 = min(b2, b1);
    ans = max(a[x] + b[b2], ans);
  }
  cout << ans;
}
