#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using db = double;
using vi = vector<int>;
const int inf = 0x3f3f3f3f;
const db eps = 1e-8;
const int mod = 1e9 + 7;
ll qpow(ll a, ll b) {
  ll ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ret;
}
const int maxn = 1e5 + 7;
int d, n, m;
ll a[maxn], b[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> d >> m;
  int x = 0, y = 0;
  for (int i = 1, t; i <= n; ++i) {
    cin >> t;
    if (t > m)
      a[++x] = t;
    else
      b[++y] = t;
  }
  ++d;
  sort(a + 1, a + x + 1);
  reverse(a + 1, a + x + 1);
  sort(b + 1, b + y + 1);
  reverse(b + 1, b + y + 1);
  for (int i = 1; i <= n; ++i) a[i] += a[i - 1];
  for (int i = 1; i <= n; ++i) b[i] += b[i - 1];
  ll ans = 0;
  for (int i = 0, t; i <= y; ++i) {
    t = (n - i - 1) / d + 1;
    ans = max(ans, b[i] + a[t]);
  }
  cout << ans << "\n";
}
