#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
bool ckmin(T &a, U b) {
  return b < a ? a = b, true : false;
}
template <typename T, typename U>
bool ckmax(T &a, U b) {
  return b > a ? a = b, true : false;
}
long long res = 0;
int n, d, m;
vector<int> v, sm, lg;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> d >> m;
  v.assign(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  for (int i = 0; i < n; ++i) {
    if (v[i] <= m)
      sm.push_back(v[i]);
    else
      lg.push_back(v[i]);
  }
  sort(sm.begin(), sm.end());
  sort(lg.begin(), lg.end(), greater<int>());
  long long cur = 0, pos = -1, oth = -1;
  for (auto i : sm) cur += i;
  for (int i = 0; i < (int)(lg).size(); ++i) {
    cur += lg[i];
    if ((i + 1) * d + i + 1 >= (int)(lg).size()) {
      pos = i;
      break;
    }
  }
  ckmax(res, cur);
  for (int i = pos + 1; i < (int)(lg).size(); ++i) {
    while (oth < (int)(sm).size() - 1) {
      oth++;
      cur -= sm[oth];
      int num = (int)(lg).size() + oth + 1;
      if (num > (d + 1) * i) break;
    }
    int num = (int)(lg).size() + oth + 1;
    if (num <= (d + 1) * i) break;
    cur += lg[i];
    ckmax(res, cur);
    if ((i + 1) * (d + 1) >= n) break;
  }
  cout << res;
  return 0;
}
