#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char ch = getchar();
  bool f = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = 1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  x = f ? -x : x;
}
const int N = 1e5 + 7;
long long n, m, d;
long long a[N], la;
long long b[N], lb;
long long s[N];
long long ans = 0;
int main() {
  read(n);
  read(d);
  read(m);
  for (int i = (1); i <= (n); ++i) {
    int x;
    read(x);
    if (x > m)
      b[++lb] = x;
    else
      a[++la] = x;
  }
  sort(a + 1, a + la + 1);
  reverse(a + 1, a + la + 1);
  sort(b + 1, b + lb + 1);
  reverse(b + 1, b + lb + 1);
  for (int i = (2); i <= (la); ++i) a[i] = a[i] + a[i - 1];
  for (int i = (2); i <= (lb); ++i) b[i] = b[i] + b[i - 1];
  for (int i = (lb + 1); i <= (n); ++i) b[i] = b[i - 1];
  for (int i = (0); i <= (la); ++i) {
    int num = (n - i - 1) / (d + 1) + 1;
    ans = max(ans, a[i] + b[num]);
  }
  cout << ans;
  return 0;
}
