#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
long long n, m, d, n1, n2;
long long a[N], b[N], ans;
bool cmp(long long x, long long y) { return x > y; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> d >> m;
  ++d;
  for (int i = 1, tmp; i <= n; i++) {
    cin >> tmp;
    if (tmp > m)
      a[++n1] = tmp;
    else
      b[++n2] = tmp;
  }
  sort(a + 1, a + n1 + 1, greater<int>());
  sort(b + 1, b + n2 + 1, greater<int>());
  for (int i = 2; i <= n1; i++) a[i] += a[i - 1];
  for (int i = 2; i <= n2; i++) b[i] += b[i - 1];
  long long tim, res;
  for (int i = 0; i <= n1; i++) {
    if (i == 0)
      tim = n;
    else
      tim = n - 1 - (i - 1) * d;
    if (tim < 0) break;
    res = a[i];
    res += b[min(tim, n2)];
    ans = max(ans, res);
  }
  cout << ans << '\n';
}
