#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, d, m, a[maxn];
int pos;
long long sum[maxn];
long long solve(int res) {
  res = res + n - pos;
  int cnt = res / (d + 1);
  if (res % (d + 1)) cnt++;
  cnt = min(cnt, n - pos);
  int l = n - cnt + 1, r = n;
  return sum[r] - sum[l - 1];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> d >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  pos = upper_bound(a + 1, a + 1 + n, m) - (a + 1);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i];
  }
  long long ans = 0, tmp;
  for (int i = 1; i <= pos + 1; i++) {
    tmp = sum[pos] - sum[i - 1];
    tmp += solve(i - 1);
    ans = max(ans, tmp);
  }
  cout << ans << '\n';
  return 0;
}
