#include <bits/stdc++.h>
using namespace std;
long long int arr[100005];
long long int pfsum[100005];
long long int pfsum2[100005];
long long int n, d, m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie();
  cin >> n >> d >> m;
  for (int i = 1; i <= (int)(n); i++) {
    cin >> arr[i];
  }
  vector<long long int> vec1, vec2;
  for (int i = 1; i <= (int)(n); i++) {
    if (arr[i] > m) {
      vec1.push_back(arr[i]);
    } else
      vec2.push_back(arr[i]);
  }
  sort(vec1.begin(), vec1.end());
  sort(vec2.begin(), vec2.end());
  for (int i = 1; i <= vec2.size(); i++) {
    pfsum2[i] = vec2[i - 1] + pfsum2[i - 1];
  }
  for (int i = 1; i <= vec1.size(); i++) {
    pfsum[i] = vec1[i - 1] + pfsum[i - 1];
  }
  long long int no = (n / (d + 1));
  if (n % (d + 1) != 0) no++;
  no = min(no, (long long int)(vec1.size()));
  long long int ans = 0;
  if (vec2.size() != 0) {
    ans += pfsum2[vec2.size()];
  }
  if (vec1.size() != 0) {
    ans += vec1[vec1.size() - 1];
  }
  int l = vec1.size();
  int l2 = vec2.size();
  for (int i = 2; i <= no; i++) {
    long long int tempans = pfsum[l] - pfsum[l - i];
    int rem = n - (i * (d + 1)) + d;
    if (rem > 0) {
      long long int tmp2 = min(l2, rem);
      tempans += (pfsum2[l2] - pfsum2[l2 - tmp2]);
    }
    ans = max(tempans, ans);
  }
  cout << ans << "\n";
  return 0;
}
