#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
int n, d, num1, num2;
long long m, sum, ans;
long long dp[MAXN], a[MAXN], pre[MAXN], vec1[MAXN], vec2[MAXN];
int main() {
  scanf("%d%d%lld", &n, &d, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    if (a[i] > m)
      vec1[++num1] = a[i];
    else
      vec2[++num2] = a[i];
  }
  sort(vec1 + 1, vec1 + num1 + 1, greater<long long>());
  sort(vec2 + 1, vec2 + num2 + 1, greater<long long>());
  for (int i = 1; i <= num2; i++) pre[i] = pre[i - 1] + vec2[i];
  ans = pre[num2];
  for (int i = 1; i <= n; i++) {
    sum += vec1[i];
    int day = (i - 1) * d;
    if (day + i > n) break;
    ans = max(ans, sum + pre[min(num2, num2 - 1 - (day - (num1 - i)) + 1)]);
  }
  printf("%lld\n", ans);
  return 0;
}
