#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 9;
const int mod = 1e9 + 7;
int n, d, m, x;
long long int dp[N], mn[N], mx[N];
vector<int> v, v1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> d >> m;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x > m)
      v.push_back(x);
    else
      v1.push_back(x);
  }
  int a = v.size();
  int b = n - a;
  sort(v.rbegin(), v.rend());
  sort(v1.rbegin(), v1.rend());
  long long int sum = 0;
  for (int i = 1; i <= a; i++) {
    sum += v[i - 1];
    mx[i] = sum;
  }
  sum = 0;
  for (int i = 1; i <= b; i++) {
    sum += v1[i - 1];
    mn[i] = sum;
  }
  long long int ans = 0;
  for (int i = 0; i <= a; i++) {
    long long int ned = (long long int)(i - 1) * (long long int)(d + 1);
    ned++;
    if (i == 0) {
      ans = max(ans, mn[b]);
      continue;
    }
    if (ned <= n) {
      int rem = n - ned;
      long long int ex = 0;
      if (rem > 0) {
        if (b >= rem)
          ex = mn[rem];
        else
          ex = mn[b];
      }
      ans = max(ans, ex + mx[i]);
    }
  }
  cout << ans << '\n';
}
