#include <bits/stdc++.h>
using namespace std;
const long long logN = 20;
const long long N = 100005;
const long long M = 1000000007;
const long long INF = 1e12;
long long pow1(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % M;
    }
    a = (a * a) % M;
    b >>= 1;
  }
  return res % M;
}
int main() {
  long long T = 1;
  while (T--) {
    long long n, d, m;
    cin >> n >> d >> m;
    vector<long long> a1(n + 1, 0), a2(n + 1, 0);
    long long i1 = 1;
    long long i2 = 1;
    for (long long i = 0; i < n; i++) {
      long long x;
      cin >> x;
      if (x <= m) {
        a1[i1] = x;
        i1++;
      } else {
        a2[i2] = x;
        i2++;
      }
    }
    sort(a1.begin() + 1, a1.end());
    sort(a2.begin() + 1, a2.end());
    reverse(a1.begin() + 1, a1.end());
    reverse(a2.begin() + 1, a2.end());
    for (long long i = 1; i < n + 1; i++) {
      a1[i] += a1[i - 1];
      a2[i] += a2[i - 1];
    }
    long long ans = 0;
    for (long long i = 0; i < n + 1; i++) {
      long long achche_mood_wale_kitne_leinge = i;
      long long bekar_mood_wale_kitne_leinge = ((n - i + d) / (d + 1));
      long long tmp_ans = (a1[achche_mood_wale_kitne_leinge] +
                           a2[bekar_mood_wale_kitne_leinge]);
      ans = max(ans, tmp_ans);
    }
    cout << ans << "\n";
  }
}
