#include <bits/stdc++.h>
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 5;
bool cmp(long long a, long long b) { return a > b; }
long long a[maxn], b[maxn];
int main() {
  long long n, d;
  long long m;
  cin >> n >> d >> m;
  long long len1 = 0, len2 = 0;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (x <= m)
      a[++len1] = x;
    else
      b[++len2] = x;
  }
  sort(a + 1, a + len1 + 1, cmp);
  sort(b + 1, b + len2 + 1, cmp);
  for (int i = 2; i <= len1; i++) {
    a[i] += a[i - 1];
  }
  for (int i = 2; i <= len2; i++) {
    b[i] += b[i - 1];
  }
  long long ans = a[len1];
  for (int i = 1; i <= len2; i++) {
    long long leave = n - (i - 1) * (d + 1) - 1;
    if (leave < 0) continue;
    long long res = b[i];
    res += a[min(len1, leave)];
    ans = max(ans, res);
  }
  cout << ans << endl;
  return 0;
}
