#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long n, m, k, s, t, d, a[N], b[N], tot, tot1, suma[N], sumb[N];
long long calc(int k) { return sumb[min(k, (int)tot1)]; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> d >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> k;
    if (k > m)
      a[++tot] = k;
    else
      b[++tot1] = k;
  }
  sort(a + 1, a + 1 + tot, greater<int>());
  sort(b + 1, b + 1 + tot1, greater<int>());
  for (int i = 1; i <= tot; ++i) suma[i] = suma[i - 1] + a[i];
  for (int i = 1; i <= tot1; ++i) sumb[i] = sumb[i - 1] + b[i];
  long long ans = calc(n);
  for (int i = 1; i <= tot; ++i)
    if ((i - 1) * (d + 1) + 1 <= n)
      ans = max(ans, suma[i] + calc(n - (i - 1) * (d + 1) - 1));
  cout << ans;
}
