#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 7;
int g[MAXN], s[MAXN];
long long sum1[MAXN], sum2[MAXN];
bool cmp(int a, int b) { return a > b; }
int main() {
  int n, d, m;
  cin >> n >> d >> m;
  int x;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (x > m)
      g[++cnt1] = x;
    else
      s[++cnt2] = x;
  }
  sort(g + 1, g + 1 + cnt1, cmp);
  sort(s + 1, s + 1 + cnt2, cmp);
  int pos = 0;
  for (int i = 1; i <= n; i++) {
    sum1[i] = sum1[i - 1];
    if (i % (d + 1) == 1 && pos + 1 <= cnt1) sum1[i] += g[++pos];
  }
  for (int i = 1; i <= cnt2; i++) {
    sum2[i] += sum2[i - 1] + s[i];
  }
  long long ans = 0;
  for (int i = 0; i <= cnt2; i++) {
    ans = max(ans, sum2[i] + sum1[n - i]);
  }
  cout << ans << endl;
}
