#include <bits/stdc++.h>
using namespace std;
const long long P = 1e9 + 7;
const long long INF = 1e18;
const int N = 1e5 + 5;
mt19937 rng(time(0));
int n, d, m, x, n1, n2;
long long a[N], b[N];
int main() {
  scanf("%d%d%d", &n, &d, &m);
  for (int i = (1); i <= (n); ++i) {
    scanf("%d", &x);
    if (x > m)
      b[++n2] = x;
    else
      a[++n1] = x;
  }
  sort(a + 1, a + n1 + 1), reverse(a + 1, a + n1 + 1);
  sort(b + 1, b + n2 + 1), reverse(b + 1, b + n2 + 1);
  for (int i = (1); i <= (n1); ++i) a[i] += a[i - 1];
  for (int i = (1); i <= (n2); ++i) b[i] += b[i - 1];
  long long ans = 0;
  for (int i = (0); i <= (n2); ++i) {
    int na = n - (i + (i - 1) * d);
    if (na < 0) break;
    ans = max(ans, b[i] + a[min(na, n1)]);
  }
  cout << ans << endl;
  return 0;
}
